Copyright: @ Integrated Data Systems, Inc. 1996.


  Main Program Window

LSX-MPEG Encoder

The area at the bottom of the Main Program Window allows the user to specify input and output file names and some other general parameters necessary for encoding. The left side shows input file information: input file name, frame width and height, amount of frames to encode, and the number of the first frame to encode. The right side shows output file information: file name, output file standard (MPEG-1 or MPEG-2), frame rate, data rate, along with a checkbox for choosing to encode the audio portion of an AVI file if present. The first step in encoding a new file is to specify the new input file name. To do so press the Browse button near the input file field. The standard Open File dialog box will appear.

Select an input AVI file to encode and press OK. If this is a valid AVI file and the system can read the header of that file, then a small information message with the parameters of this AVI file will appear. This dialog box displays the following information if it is available: frame format, frame rate, number of frames, playback duration, compression type, compression ratio, audio format, and audio frequency. If the specified file cannot be opened or is not a valid AVI file, an appropriate error message will appear.

The input AVI file must have even width and height. If one of those values is not even, an error message will appear. Width and height of frame in the input file automatically appear in the edit boxes Width and Height. Currently the program cannot scale or crop input frames. So these values cannot be changed by the user. That is why the dialog items are grayed out when an AVI file is selected.

Edit boxes Frames to encode and Number of first frame automatically receive values of the first frame and the number of frames in the file.

You can also directly enter a new file name in the Input File edit box. The program will try to read the header of that input file when you press enter or when you click on another dialog item. You can also drag an input AVI file name from the File Manager window and drop it anywhere in the LSX-MPEG Encoder program window. If the program cannot find the specified input file, or if it is not a valid AVI file, then the error message failed to open AVI file or file format error will appear.

The user may prefer to encode only some portion of the input file. Only one interval can be selected. If you need a more complicated operation, like concatenating several subintervals or merging several AVI files or changing frame sizes, then use any video editing program and create an appropriate input AVI file prior to using the LSX-MPEG Encoder. When doing so, as well as when creating an input AVI file by any capturing or editing system, try to provide the best possible quality for input. Use a non-compressed AVI file, or, if compressed by some codec, then choose the highest possible data rate to avoid artificial noise and distortions on the image. Note that the LSX-MPEG Encoder works significantly better if the input video image has high quality and low noise level.

To specify an interval inside an AVI file, enter the number of the starting frame in the edit box Number of first frame, and enter the amount of input frames to encode in the edit box Frames to encode. Obviously, the number of the starting frame must be 0 or positive and the amount of input frames to encode plus the number of the starting frame must be less than the number of the last frame in the AVI file.

Note that the amount of encoded output frames may not be the same as the specified amount of input frames to encode if the frame rate of the input file is different from the output frame rate.

When the user selects a new input file name the output file name is changed automatically and default names given to temporary files based on the input file. The default output file name and directory will be the same as the file name and directory of the input file, but with the extension .mpg or .m2v depending on the output file type specified (MPEG-1 or MPEG-2). All other parameters of encoding remain the same when a new input file is selected except the ones that are filled in by the AVI file when it is opened, like frame size and whether audio is present or not.

The user can choose to encode MPEG-1 or MPEG-2 files, and/or to choose to encode audio if appropriate. The user also has the choice of multiplexing an audio stream into the MPEG system file as well (MPEG-1 only). This choice is given by the Audio checkbox.

To change the output file name press the Browse button near the output file field. The standard Save File dialog box will appear.

To change the output file encoding standard, press on the MPEG-1 or MPEG-2 radio button. When selecting the standard keep in mind the different properties of these standards. MPEG-1 is designed for medium quality video and standard CD-ROM data rate. Most existing software and hardware MPEG players on personal computers support MPEG-1. The MPEG-2 Standard was designed later. It supports high quality video encoding and high data rates. Many existing MPEG players do not support MPEG-2. So if you are concerned about compatibility and want the resulting MPEG file to play on many different systems, you should select MPEG-1. For the same input files and data rates, the MPEG-2 video stream may have slightly less quality than the MPEG-1, on low data rates.

MPEG-2 has advantages for high frame sizes, high frame rate of video, and large data rates.

The size and quality of output MPEG files depend most of all on the frame rate and data rate parameters.

The MPEG standard specifies the following frame rates:  23.976, 24, 25, 29.97, 30, 50, 59.94, and 60 frames/sec. There is no support for other frame rates.

Currently, the LSX-MPEG Encoder supports the following frame rates  23.976, 24, 25, 29.97, and 30 frames/sec. If your input AVI file has one of the frame rates in this list, then just set the same frame rate for the output MPEG file. Even if the input AVI file has one of the frame rates in the list, you may need to create an MPEG file with a different frame rate. The frame rate conversion procedure will be applied as described below.

The LSX-MPEG Encoder has 2 different modes of frame rate conversion to encode files with frame rates different than the frame rate in the input file. The first option is to keep original playback time in the input file. This is the default mode and this is the only available option when encoding video and audio. In this mode the program may duplicate or skip some input video frames to ensure proper synchronization. Another option is to keep original frame sequence. In this case the playback time and speed of the output MPEG file will be different from the original. This option and the first option are available when compressing video streams without audio (audio disabled or not present in the input file). These options can be selected from the "Sync" property dialog window in the "Advanced" dialog box. When the user selects a new AVI file and the new file has an audio stream the default option is selected automatically.

To set the output data rate enter the required value in the Data rate edit box ( in Kbytes/sec ).

Some commonly used data rates are

single speed CD-ROM	150 Kbytes/sec
double speed CD-ROM	300 Kbytes/sec
ISDN line          	16 Kbytes/sec

The program sometimes may not be able to create an MPEG file with the exact required data rate. It will try to keep the average data rate as close to the required as possible. Consequently, if you need to make sure that the data rate will not temporarily exceed some maximum value (for example data transfer rate of some data channel), you may need to specify a smaller data rate to have some threshold before the maximum value (the total size of the fully encoded file is the addition of audio and video data plus some small amount for header and timing information). There is always some minimum limit of the data rate depending on input frame sizes, frame rate and statistical characteristics of a particular video file that can be achieved with MPEG encoding. The MPEG standard is not designed for very low data rates. So do not expect good image quality when specifying very low data rates: that corresponds, for example, to conventional modems and phone lines.

If you want to change any other encoding parameters, press the Advanced button. The Advanced parameters dialog box will appear. See the next section about using the Advanced dialog box.

Select here to go to Special Parameters Property Page discussion.


Advanced Parameters dialog box

LSX-MPEG Encoder

The Advanced Parameters dialog box appears when the user presses the Advanced button on the main window. It contains a tab dialog box with 10 individual dialog boxes (property pages): Motion Vectors, Sequence, Performance, Picture, Audio, Files, Sync, System, Special, and Constrained. Use the tab bar to select the necessary property page. When required data is entered press OK to confirm changes and close the Advanced Parameters dialog box. The program will ensure all data values are valid, and if some are not valid then an appropriate message will appear and the dialog box will remain opened to let the user correct the data. Press the Cancel button to quit and not save changes.

Based on the main menu option selected and the status of the audio checkbox some property pages may not be displayed. In the case where the AVI file does not have an audio component, there will not be an Audio, and/or System Property page displayed in the Advanced Parameters Property Page. Likewise, if the MPEG-2 encoding button is selected there will not be a Constrained Property Page displayed in the Advanced Parameters Property Page since the Constrained Parameters refer to MPEG-1 encoding only.

Motion Vectors Property Page

Sequence Property Page

Performance Property Page

Picture Property Page

Audio Vectors Property Page

Sync Vectors Property Page

Files Property Page

System Property Page

Special Property Page

Constrained Property Page


MPEG Encoder Contents
  The LSX-MPEG Encoder

LSX-MPEG Encoder

Introduction to the LSX-MPEG Encoder
Quick Start Tutorial
Main Menu
Toolbar
Main Program Window
Advanced Parameters Dialog Box
Motion Vectors Property Page
Sequence Property Page
Performance Property Page
Picture Property Page
Audio Vectors Property Page
Sync Property Page
Files Property Page
System Property Page
Special Property Page
Constrained Property Page
File Formats
MPEG Encoding Parameters
Understanding MPEG
Running the LSX-MPEG Encoder
Achieving Best Results
Achieving Fastest Encoding
Achieving Best Quality
Achieving Optimum Quality and Performance
Encoding Files with Low Bitrates
Encoding a New File
Frequently Asked Questions
Glossary


Input File Formats
  File Formats

LSX-MPEG Encoder

The LSX-MPEG Encoder takes input video streams from Windows AVI video files. A video codec necessary to decompress a particular video encoding format must be installed on your system. Video codec must be able to decompress video frames to RGB (24 bits/pixel) or palette-based 8 bits/pixel uncompressed bitmaps. Most video codecs in Microsoft Video for Windows can decompress to at least one of these formats. But some rarely used or old video codecs cannot. This means that you cannot directly use video files such as these as input for the LSX-MPEG Encoder. In this case you can use any video editing software to convert this AVI video file to some other video compression format that the LSX-MPEG Encoder understands. Some video codecs, for example some motion JPEG video codecs, may require a special kind of video compression and video capturing hardware be installed on your system to be able to decompress this particular video file format.

In fact, the program will accept video frames from almost any input AVI file if your system has an appropriate AVI video codec installed and can play that AVI file. The program depends on the Video for Windows capability to decompress particular video compression formats. If the program refuses to read the video stream from a particular AVI file then the user needs to install an appropriate video codec for Windows.

The current version of the LSX-MPEG Encoder cannot crop or scale input video frames. If you wish to encode MPEG files with frame sizes different from the input file, then use any video editing program to convert (crop or scale) the image format before encoding.

The program can encode an AVI file with any even frame width and height value. If one of the values in the input file is not even, then the program will display an error message informing you that the file cannot be encoded. There are also some other limitations on image width, height, and frame rates that may apply according to the program's capabilities as well as the MPEG standard itself. See Contrained Parameters for a definition of constrained parameters.


Introduction
  Introduction to the LSX-MPEG Encoder

LSX-MPEG Encoder

The LSX-MPEG Encoder is a program capable of encoding AVI files into MPEG files.

Specifically, the LSX-MPEG-Encoder can create MPEG-1 and MPEG-2 video streams. It also can create MPEG-1 Level II audio stream files, mono and stereo, and MPEG-1 system stream files with multiplexed video and audio streams.

The LXS-MPEG Encoder is optimized to achieve very fast encoding for most frame sizes and frame rates of video required in multimedia applications.

Advantages: Intel, DEC Alpha processors, and MMX technology support for maximum speed of MPEG video encoding. The LSX-MPEG Encoder rocognizes that it runs on MMX compatable processors and will display a small MMX icon at the top right part of the screen when the MMX instructions are being used.

For more information on MMX, how the LSX-Encoder uses it or how to customize you MMX enabled system please check out the General User Questions section.

Revolutionary new motion estimation algorithm for fastest MPEG encoding. Due to this new algorithm the LSX-MPEG Encoder works several times faster than formerly known MPEG encoding software while providing virtually the best possible compression quality.

Special mode for creating very low data rate MPEG video files, which makes the program great for creating MPEG files for Web pages.

Simple and intuitive interface that is easy for new users and lets experienced users control a number of MPEG encoding parameters.

Our super fast algorithm of motion estimation is available for licensing for software and hardware implementations of image compression and recognition.

Contact Us:
Ligos Corporation
Phone: (912) 236-4374
Fax: (912) 236-6792
E-Mail: (comments and suggestions) mpeg@ids-net.com

Ligos Corporation Home Page:  http://www.ligos.com

Technical Support: Technical support is provided by E-Mail only. Bug reports are welcome. Please send questions and bug reports to the following address: techspt@ids-net.com.


  Main Menu

LSX-MPEG Encoder

There are several pull-down menus in the LSX-MPEG Encoder main window. They are related to loading and saving profile files, controlling the MPEG encoding process, and setting viewing parameters.

The following is a list of these menu options.

File	When selected the File pull-down menu will
display a list of the following
options (see below)

Reset All Parameters	Ctrl-R	will reset all parameters to default values
and prepare the program to start
working with the default parameters.

The profile file is a file containing all encoding parameters that you have previously specified to encode some file and save on a disk. It is the profile file that is loaded, saved or created when using the file menu options. The purpose of using profile files is to save a set of the parameters of encoding that you expect to be useful later. Profile files also contain current input and output file names, and some internal encoding parameters that the program currently has set by default, but may become user-selectable in the next program version.

Open Profile File	Ctrl-O	will open a selected profile file
and load all encoding parameters from that
file. It will also set input and output files
as specified in the profile file.

Note that if you are already working with some profile file and try to open that profile file once more, the program will not read the file a second time. That behavior may or may not be changed in the next version of the program.

Save Profile File	Ctrl-S	will save in a currently
active profile file all current encoding
parameters and input and output
file names.

Save Profile File As	same as the Save option, but it will show
the standard Save File dialog box to let
the user specify a different profile file name
 	or create a new profile file.

Recent Files	This list represents the 5 most
recently used profile files. Press on any of
these file names to open that profile file.

Exit	will exit the program. If the program is in
the process of encoding an MPEG file,
then this option will stop the
encoding but will not exit the
program. When encoding is
completed or stopped, you can
safely exit the program.

Action	When selected the Action pull-down menu
will display a list of the
following options:

Start Encoding	Alt+R	will start encoding an MPEG file.
This option is activated only when an
input file is selected or an
existing profile file is loaded.

STOP Encoding	Alt+S	will stop encoding an MPEG file.

PAUSE Encoding	Alt+P	will suspend the MPEG encoding process.
To continue encoding, press this option
one more time or press the
Pause button on the toolbar.

View	When selected, the View pull-down menu
will display a list of options that
determine how the program will show
input and output frames during
encoding. These options are
equivalent to options in the
Picture Property Page located in
the Advanced parameters dialog box.
These options do not affect the
output file. They affect only the
appearance of the program output
during encoding.

Show Input Stream Frames	Alt+I	when checked this option
enables the MPEG Encoder to show input
frames during encoding.

Show Output Stream Frames	Alt+O	when checked this option
enables the MPEG Encoder to show
output frames during encoding.

Automatically Set Window Size	Alt+C	when checked this option
enables the program to adjust window size
before encoding.

Scale Images To Window	Alt+W	when checked this option enables the
program to scale input and/or output
frames to fit entirely into a window
(otherwise the program may crop
the image).

View Toolbar	Alt+T	when selected this toggle selection
will turn on or off the toolbar.

Show AVI File Information	when selected this will display the
currently selected AVI files' information.

Save current view parameters	when selected will save the current
view parameters. These parameters
are enable/disable input/output
windows, automatically set size,
and window scaling.

Help	When selected the Help pull-down menu
will display a list of the
following options.

Help Topics	F1	will activate on-line help.

About This Program	will show the About dialog box.

Most of the menu functions are available by some other means also. For example, options in the Action pull-down menu are paired with toolbar buttons. Settings from the View menu can also be changed from one of the property pages in the Advanced parameters dialog box.

Select here to go to the Advanced Parameters Dialog Box discussion.


Parameters
  LSX-MPEG Encoding Parameters

LSX-MPEG Encoder

The LSX-MPEG Encoder can create MPEG-1 audio streams, MPEG-1 and MPEG-2 video streams, and MPEG-1 system streams. There are many different parameters that can affect output MPEG streams. Developers of the LSX-MPEG Encoder made the selection of these parameters as simple and intuitive as possible; many optional parameters are specified in the program, by default, to some reasonable values. But because of the complicated nature of the MPEG standard, there are still many parameters definable by the user. In order to efficiently use the LSX-MPEG Encoder for creating high quality video files, the user has to understand the role of each parameter and the way to set the parameters to suitable values to achieve the desired properties in the output MPEG video file.

In this section we describe all user-selectable parameters in brief and discuss what the effect on the output MPEG file the parameters have. A discussion of how to select values for parameters in the different dialog boxes of the LSX-MPEG Encoder is provided in the section Running the LSX-MPEG Encoder

Frame Rate and Data Rate Parameters

The main parameters that affect the quality and properties of the output MPEG video stream are frame rate and data rate.

A correct frame rate for the output file must be specified to play an MPEG video file with correct speed. In general, it must be the same as the frame rate in your input AVI video file. The MPEG standard specifies several possible frame rates. Problems begin when the input AVI file frame rate is not specified by the MPEG standard.

The MPEG standard specifies the following input frame rates:  23.976, 24, 25, 29.97, 30, 50, 59.94, and 60 frames/sec. There is no support for other frame rates.

Currently, the LSX MPEG Encoder supports the following output frame rates  23.976, 24, 25, 29.97, and 30 frames/sec. If your input AVI file has one of the frame rates in this list, then just choose the same frame rate for the output MPEG file. It is possible to choose an output frame rate that is different from the input frame rate.

To encode files with unsupported frame rates, our MPEG encoder has 2 modes: if Keep original number of frames is selected then the program will encode frames as they come from an input file, but MPEG players will play these files at the wrong speed; if Keep original duration (default) is selected then the encoder will duplicate or skip some input frames to provide correct playback frame rate at the time of playing the MPEG file.

If both options are not satisfactory, i.e. you want to be able to play an MPEG file with the correct frame rate but the frame rate is not in the list above, and you do not want to allow the encoder to duplicate or remove frames, then you probably need some special MPEG player that allows you to specify nonstandard frame rates at playback time.

In order to be able to continuously play an MPEG file from a particular data storage device or transmit it through a particular data channel, it is usually necessary to specify the limit of data rate in the output file. The LSX-MPEG Encoder allows the user to set the frame rate of the output file in Kbytes per second. The program will try to keep the data rate as close to the required setting  as possible. Note that there may be some small fluctuations of the data rate around that value. Obviously, the more Kbytes per second the data rate is allowed, the higher quality of images in the output video stream.

For example, the data rate of a file that has to be able to play from a single-speed CD-ROM is 150 Kbytes/sec. That is a comparatively low data rate, and the program may not be able to encode the MPEG file with this data rate and keep the desired image quality. To increase the quality of the images in the output video stream, it may be necessary to increase the data rate. Usually data rates of 300 - 600 Kbytes/sec allow the program to achieve good image quality in the output video stream. When dealing with constrained parameter files the maximum data rate is 226Kbytes/sec. You must disable the constrained parameter option on the constrained property page if you wish to obtain files encoded with higher data rates.

The quality of the output video stream depends also on frame sizes, frame rate, and in some instances other parameters discussed in the following sections.

NOTE: If ultra low data rates, like 16 or even less Kbytes/sec is required, the quality of the output video stream may be degraded. The MPEG standard does not allow the user to achieve ultra low data rates even with comparatively small frame sizes and frame rates.

Select this link for information on Encoding Files with Low Bitrates.

Maximum Motion Vectors

The MPEG video encoding standard utilizes motion estimation to reduce the data rate of video streams. The process of searching for the closest block of pixels on the previously encoded frame is called motion estimation. It means that for each square block of pixels on the currently encoded frame, the most similar block of pixels on the previously encoded frame is selected and represented by a pair of horizontal and vertical displacement values, named motion vector. See Understanding MPEG for more information.

The user can specify maximum values of vertical and horizontal components of motion vectors. The larger the maximum motion vector values, the greater the probability is that you will find a block of pixels that will best suit the image conversion with a fixed output data rate. On the other hand, as maximum motion vector values are increased, more time is necessary to search for the best suited pixel blocks in the area limited by the maximum motion vectors; so the program encodes more slowly. Also, as maximum motion vector values are increased, the amount of bits necessary to represent motion vectors in the output file is increased, which may reduce the overall quality of the output image with fixed output data rates. So there are usually some optimum values of maximum motion vectors for particular video stream requirements and input video files.

The recommended rule is to set maximum motion vector values large enough to represent the motion of objects on the screen during a time interval of one or several frames. The motion vector values selected should be appropriate for the processing environment and the output desired.

An MPEG video stream can have three different kinds of encoded frames: I, P, and B frames (see Understanding MPEG for details). In the next section we will discuss how the user can specify a sequence of I, P, and B frames. Usually the output stream contains several B frames between each of the  nearest P frames, and several groups of P and B frames between the nearest I frames. Here we note that motion vectors for P frames must be long enough to represent the motion of objects between the nearest P frames, and for B frames the motion vectors must be long enough to represent the motion of objects between the current B frame and each of (or at least one of) the nearest P frames. So, P frame motion vectors are usually longer than B frame motion vectors. In choosing maximum motion vectors, the user should take into account the motion properties of a particular input video file. For example, usually objects on the video move faster horizontally than vertically. So maximum values of horizontal motion vectors can be larger than vertical ones.

Provided are two examples of possible maximum motion vector values. This is just an illustration. The user may have to choose motion vectors suitable for particular conditions or can just leave the settings as they are in the program by default.

Example 1:
For fast motion video and large frame sizes, maximum motion vectors could be chosen as

P frame maximum horizontal motion vector	32, 40
P frame maximum vertical motion vector	24, 32

B frame maximum horizontal motion vector	24
B frame maximum vertical motion vector	16

Example 2:
For slow motion video and small frame sizes, maximum motion vectors could be chosen as

P frame maximum horizontal motion vector	24
P frame maximum vertical motion vector	16

B frame maximum horizontal motion vector	16
B frame maximum vertical motion vector	8

There are no strict rules about choosing the best maximum values of motion vectors because of the unknown statistical nature of input video. If the best possible quality is desired, the user should try to encode the same input file with different maximum values of motion vectors and try to adjust motion vector values to achieve the best results.

Other parameters that affect quality and performance

There are many other parameters that may affect the quality of MPEG video output and/or performance of the LSX-MPEG Encoding program.

As was mentioned in the previous section, an MPEG video stream can have three different kinds of encoded frames: I, P, and B frames (see Understanding MPEG for details). It is up to the user to specify the required sequence of encoded frames. Frames are coupled into groups between the nearest I frames. Each group consists of a fixed number of subgroups having one P frame and several B frames.

This program requires the user to specify the amount of B frames between the nearest P frames and the amount of P frames ( subgroups comprising P and B frames ) between the nearest I frames. When choosing these values keep in mind that encoded I frames are usually significantly larger than P or B frames and P frames are larger than B frames. It is usually useful to increase the amount of P frames between I frames because this reduces the total amount of I frames in the stream. The value should not be too large, to avoid reduction in quality and to allow fast forward and backward movement operation when using an MPEG player that requires I frames. The optimal amount of B frames between the nearest P frames is usually in the range of 2 - 3 for most conditions. It is sometimes required to have an MPEG file comprised of  only I and P frames or only I frames (editable MPEG). The encoding of P frames takes more time than encoding I frames because it requires the procedure of motion estimation. The encoding of B frames takes slightly more time than encoding P frames because B frame encoding requires two procedures of motion estimation, one applied to the previous P or I frame and one applied to the next P or I frame.

The sequence of frames can be represented by a sample string of letters, from one nearest I frame to the next.

Here are some examples:

Input...	Frame Sequence...
The default program parameters are: amount of P frames = 3, amount of B frames = 2. These parameter values are acceptable in most cases.	Corresponding sequence of frames is  I BB P BB P BB P BB I ...
To improve image quality for a fixed data rate, it is sometimes useful to increase the amount of P frames. If a user specified amount of P frames = 5, amount of B frames = 3.	Corresponding sequence of frames is   I BBB P BBB P BBB P BBB P BBB P BBB I ...
If only I and P frames are required, then for example,  amount of P frames = 15, amount of B frames = 0.	Corresponding sequence of frames is   I P P P P P P P P P P P P P P P I...
If only I frames are required, then the parameters should be:  amount of P frames = 0, amount of B frames = 0.	Corresponding sequence of frames is    I I I I I I I I I I I I I I I I I I I I I I I...

NOTE: An MPEG video file having only I or I and P frames has poorer quality or requires a larger data rate than a normal MPEG file with I, P, and B frames. So do not set the program to make an MPEG file with I or I and P frames only, unless it is necessary.

The LSX-MPEG Encoder will not accept a non-zero amount of B frames and a zero amount of P frames. If these parameters are entered, an error message will appear.

The motion estimation subsystem of the LSX-MPEG Encoder has 5 modes of operation: "very fast", "fast", "normal", "slow", and "very slow". Theoretically, the slow motion estimation produces a higher quiality output stream for a particular data rate. In practice, however, our motion estimation algorithm is capable of providing almost perfect results even in "fast" search mode. Moreover, "slow" and "very slow" modes of encoding sometimes do not provide a significant gain in quality and can in some cases even slightly reduce output MPEG video stream quality because of the statistical properties of a particular input video stream. If "slow" or "very slow" mode of encoding is selected, the performance of the program is somewhat degraded as compared to "fast" mode. Note that even in the "very slow" mode of encoding when the program provides the best possible search results, it still works many times faster than previous full search motion estimation algorithms.

In most practical cases, "normal" search mode, which is selected by default, provides a good quality of output MPEG video stream without sacrificing the speed of encoding.

A special set of skip frame modes in the LSX-MPEG Encoder are designed to help create MPEG files with very low data rates. These modes may also help to increase the picture quality of the output MPEG file when the input AVI file has a frame rate lower than any standard MPEG frame rates.

The MPEG standard specifies the following frame rates:  23.976, 24, 25, 29.97, 30, 50, 59.94, and 60 frames/sec. There is no provision in the standard for support of frame rates lower than 23.976 frames/sec.

The LSX-MPEG Encoder program can create MPEG files with frame rates:  23.976, 24, 25, 29.97  and 30 frames/sec.

Input AVI files may have a frame rate that is not in this list. In this case the program may duplicate or skip frames to keep proper synchronization and playback duration. AVI files often have frame rates less than 15 frames/sec. When encoding AVI files such as these most of the input frames will be duplicated to obtain one of the standard MPEG frame rates.

The special skip frame mode may help to avoid encoding of duplicated frames. It also helps to reduce the visible frame rate for files with a very low data rate. It is often acceptable to sacrifice visible frame rate but keep better visible picture quality.

The visible frame rate can be reduced by creating a special "skip" frame mode.

There are 4 options in the "Special" property page to control skipped frames: "normal mode" (do not skip), "skip 1 B frame", "skip 2 B frames", "skip all B frames". The default is "normal mode", which disables frame skipping. Other options specify how many B frames in a subgroup sequence will be skipped. The skipped B frame is essentially a B frame with no picture change information. When decoded by a standard MPEG player these skipped B frames will repeat the picture from the nearest P frame in the sequence.

The effect of using skipped frames depends on the specified sequence settings.

Default values of the encoding parameters

The following is the list of default values of encoding parameters. These values are selected when the program starts or when a user presses on the New profile button on the main toolbar.

Output stream	MPEG-1
frame rate	25 frames/sec
output video stream data rate	200 Kbytes/sec

Maximum motion vectors
for P frame	32, 32
for B frame	16, 16
Number of P frames	3
Number of B frames	2 (that corresponds to the default frame sequence
I BB P BB P BB P BB I ...)
Performance mode	"Normal speed"
Synchronization	"keep original duration"
Constrained Parameters	YES
MPEG-1 Video stream	YES
Skip frames	NO
Bitrate of audio stream	64 Kbits/sec for mono streams and
128Kbits/sec for stereo streams.

There are also many other parameters that can be specified when encoding MPEG video streams. To simplify user operation, most of the parameters are automatically set when possible. In practice, most  users do not need to know the values for these parameters. But some MPEG professionals may need to know the exact values for all parameters. The following is a list of the default values of other parameters. This list is provided for reference purposes only.

Since this information is for the advanced user only, the explanation of each parameter will not be listed here.

vbv buffer size (constrained)	40 Kbytes
vbv buffer size (all others)	224 Kbytes
MPEG-2 profile	main profile
level	main level
format	YUV 4:2:0
color primaries	ITU-R Rec. 624-4 System B, G
transfer characteristic	ITU-R Rec. 624-4 System B, G
MPEG-2 DC coefficient precision	10 bit.


Encoding Files with Very Low Bitrates

LSX-MPEG Encoder

A special set of skip frame modes in the LSX-MPEG Encoder are designed to help create MPEG files with very low data rates.

The MPEG standard specifies the following frame rates:  23.976, 24, 25, 29.97, 30, 50, 59.94, and 60 frames/sec. There is no provision in the standard for support of frame rates lower than 23.976 frames/sec.

It is usually not possible to transmit a video sequence with a high frame rate and a high image quality with very low data rates suitable for modem communication over telephone lines and other applications.

It is often acceptable to sacrifice visible frame rate but keep better visible picture quality.

There is a way to reduce visible frame rate by creating a special "skipped" frame which is essentially a B frame with no picture change information. When a file with skipped frames is played by a standard MPEG player these frames repeat the picture of the nearest P frame.

The use of skipped frames allow the encoder to allocate more bits of data for encoding of other non skipped frames improving the visible picture quality.

The more skipped frames allocated in the frame sequence the better the visible quality of the remaining non skipped frames will be.

The maximum possible allocation of skipped frames is achieved by selecting the "Skip all B frames" option in the Special property page of the Advanced dialog window.

To increase the amount of skipped frames in this mode make the total amount of B frames larger in frame sequence settings.

Do not make the amount of B frames too large because the effective visible frame rate may drop below the acceptable value.

Try to keep some reasonable correspondence between the visible frame rate and visible picture quality for a particular video source and required data rate.

For example, selecting the "Skip all B frames" option, when the frame rate is 25 frames/sec, and 5 B frames, 3 P frames in the sequence will effectively result in a visible frame rate of 5 frames/sec. Which may be sufficient for some low data rate applications.

In some special video applications, like multimedia presentations or training materials it could be acceptable to reduce the visible frame rate even more. The program allows a maximum of 30 B frames in the sequence. A special video application used in combination with the special "Skip all B frames" mode could theoretically allow the user to have a visible frame rate less than 1 frame/sec.

Note: The use of skipped frame modes are consistent with the MPEG encoding standards. A standard MPEG player should play these files correctly. But some MPEG video players may fail to decompress files with skipped frames. This is a limitation of the particular MPEG video player.

The other measures that can be used to obtain a very low data rate and keep acceptable picture quality are: try to find the best suited combination of maximum motion vector values, frame sequence settings and program performance settings. Usually shorter maximum motion vector values should be selected for small frame sizes and/or slow motion on the picture. Increasing the amount of P frames in the sequence may help to improve the picture quality in a low data rate file. Reducing the encoding speed to "slow" and "very slow" modes may or may not improve picture quality for particular encoding conditions.


  Motion Vectors Property Page

LSX-MPEG Encoder

This dialog box prompts the user for maximum values of horizontal and vertical motion vectors for P and B frames. The right choice of maximum motion vector values helps to achieve the best possible quality for a particular data rate. There is no general rule how to choose maximum motion vectors. If the motion vectors are too short, this prevents  the encoding of a good quality image. If motion vectors are too long, this may also reduce the quality of the image as well as taking more time to encode. For a new input file you can encode the first time with default values ( 32 for P frame and 16 for B frame ) and later try to adjust the values. Optimum values are usually in the range 16 - 32, maximum value is 64.

Choosing the optimum maximum motion vector values is complicated and depends on the motion activity of the particular source video. The maximum motion vectors should be long enough to cover the maximum visible object motion on the screen. Usually the P frame motion vectors must be longer because it covers the maximum visible object motion between the nearest P frames. The interval between P frames depends on frame sequence settings ( It is equal to the specified amount of B frames in the subgroup ). The B frame motion vectors may be shorter but they should cover the maximum visible object motion between the current B frame and nearest P (I) frames. The motion vectors must be longer in the direction of the most probable object motion. Usually you may set maximum horizontal motion vector values slightly larger than vertical, and P frame motion vectors larger than the same values for B frames.

Motion vectors that are too long may not improve picture quality. In fact motion vectors that are too long may even reduce quality for a low data rate, because encoding long motion vectors takes more bits and therefore less bits are left for picture coding itself.

NOTE: maximum motion vectors must be positive values (multiples of 8). If you enter 0, a negative value or a value which is not a multiple of 8, then the program will consider it an error and give an appropriate error message when you close the Advanced Parameters dialog box. The up and down arrows near the edit boxes for maximum motion vectors increase and decrease values by minimum steps equal to 8.


Sequence Property Page

LSX-MPEG Encoder

This dialog box prompts the user to set the amount of P and B frames in the output file (see Parameters that affect quality and performance ). The user can increase or decrease the number of P frames between the nearest I frames and the number of B frames between the nearest P frames. The string Current frame sequence settings represents the sequence of frames that is specified. You can see how that string changes when you change values in the Number of P frames and Number of B frames fields. You cannot directly edit the frame sequence string. There are three buttons on the bottom of this dialog box. These buttons help the user set P and B frame numbers for one of three possible standard sequences: I frames only, I and P frames (no  B frames), and default sequence (number of  P frames 3, number of B frames 2 ). The default sequence is suitable in most cases. The optimum value for the number of B frames is 2 or 3. If you want to achieve the best quality for a limited data rate then you may want to increase the amount of P frames up to 10 or 12.

NOTE: An MPEG video file having only I or I and P frames has less quality or requires a larger data rate than a normal MPEG file with I, P, and B frames. So do not set the program to make an MPEG file with I or I and P frames unless it is necessary.

Setting a non-zero amount of B frames and a zero amount of P frames is not allowed. These parameters will not be accepted by the LSX-MPEG Encoder, and an error message will appear.


Performance Property Page

LSX-MPEG Encoder

This dialog box prompts the user to select one of the five modes for motion estimation: "very fast", "fast", "normal speed", "slow", "very slow". To choose an appropriate performance mode press the corresponding radio button. Theoretically, the slow mode of motion estimation should provide better quality of encoding. However, our motion estimation algorithm usually provides sufficiently high quality with "normal" speed. "Slow" and "very slow" modes sometimes provide slightly better quality but sometimes may not provide any gain in quality. It depends on the statistics of a particular video stream, data rate, and maximum motion vectors specified. In most cases "normal" mode provides good quality and sufficiently fast encoding.


Picture Property Page

LSX-MPEG Encoder

This dialog box prompts the user for parameters that determine how the program will show input and/or output frames in the process of encoding. None of the parameters affects the resulting output MPEG file. You can choose whatever parameters you want. You can enable or disable the program to show input and output video streams during encoding. To do so check or uncheck one or both of the checkboxes: Show input stream when encoding and Show output stream when encoding. By default, the program shows both input and output video streams, but this may slow down the encoding process, especially on slow computers. Fast computers running Windows NT 3.51 can also be slow because it has slow graphics operations. So you may want to disable one or both if you need fast encoding.

The other two items specify how the program will show input and/or output video streams during encoding. If the Automatically resize window on encoding is checked, the program may change the size of the main window on the screen before encoding to fit the entire video frame in the window if it is possible; or will make the largest possible screen (but not a full screen window) if screen space is not large enough. This option is enabled by default. If  Stretch image is checked, the size of the visable image may be scaled to fit the window. The program will try to preserve the correct aspect ratio of the image. If this item is not checked (disabled), the program will crop the center area of the image if it cannot fit entirely in the window. This option is disabled by default. Note that scaling the image takes some additional time and for that reason may slow down the process of encoding.

The last checkbox, Calculate image quality when encoding is in progress, enables the program to calculate the average quality of the entire output video stream and quality characteristics of the last encoded frame. These characteristics may be useful when choosing the best parameters of MPEG encoding for a particular input file. Calculation of quality takes some additional time, so you may prefer to disable it if you want fast encoding. It is enabled by default. You can see the representation of values of average and last frame quality during the process of encoding if it is enabled. They are also represented in the final message box that appears when encoding is completed.

NOTE: There is no common definition of what makes a measure of quality encoded video. In this program, quality measure is based upon the sum of square values of differences between the original pixel on the input frame and the corresponding pixel on the output frame. This value is transformed in the program so that the maximum possible quality representing the output value is 100, the minimum possible quality represented is 0. A quality value of 40 or more usually corresponds to good subjective image quality.


Audio Property Page

LSX-MPEG Encoder

This dialog box prompts the user for audio information. The mode of the audio stream is specified by Mono, Stereo, Dual Channel, or Joint Stereo. The audio stream data rate is in Kbits/sec.

The most significant parameter is the audio stream data rate. The default audio data rates are 64 Kbits/sec for mono and 128 Kbits/sec for stereo sound. Maximum available audio data rates are 192 Kbits/sec for mono and 384 Kbits/sec for stereo sound. If the input AVI file has a mono audio stream then the output MPEG file also has mono audio. If the input file has a stereo audio stream then the output MPEG file may have one of 3 possible encoding modes: stereo, dual or joint stereo. The stereo mode is preferable for best sound quality with high data rates. The joint stereo mode may improve sound quality on low data rates.

When "dual channel" mode is selected it simulates the "stereo" mode, but is used in special applications to represent 2 different sound channels. "Stereo" mode contains only one sound channel.


Files Property Page

LSX-MPEG Encoder

This dialog box prompts the user for temporary output video and audio files. The user has the choice of browsing for a previous filename or he/she can directly input a filename into the space provided. Since these files are used for intermediate encoding information, the user has the option to have these temporary files deleted after encoding is completed.

The LSX-MPEG encoder creates an output MPEG file in 3 steps: 1. video stream is encoded into a temporary file, 2. audio stream is encoded into a temporary file, and 3. video and audio are multiplexed into a system stream output file. The program allows you to skip the 1st and/or 2nd step of encoding if you already have a file with video or audio stream created. This is convenient when the user needs to change the video/audio encoding or multiplexing options and does not want to repeat audio/video encoding every time. To use this option with existing video/audio stream files, the temporary file name in the "Files" property page must be the same as the existing filename. If you do not want the temporary files with video or audio streams to be deleted after the encoding (default mode) then disable the option "delete temporary video/audio file after encoding" in the Files property page. When encoding with existing audio or video stream temporary files answer "No" on the warning message to skip the encoding of this video (audio) stream and use the existing file.


System Property Page

LSX-MPEG Encoder

This dialog box prompts the user for MPEG-1 system stream parameters. There are fields for entering packet size, packets per pack ratio, size of video buffer, and size of audio buffer. The user is also asked if the encoding process should use a fixed bitrate in the multiplexed output stream. The LSX-MPEG Encoder has a default encoding setting of "variable bitrate" but the "fixed bitrate" option is given to allow the output encoded by the LSX-MPEG Encoder to be compatable with other MPEG players that accept only fixed bitrates.

The Pack Size should be less than or equal to 4096 bytes. Packets per pack ratio should be less than or equal to 4. Video buffer size should be between Pack Size/1024 and 46 Kbits. Audio buffer size should be between Pack Size/1024 and 4 Kbits.

Some hardware MPEG players fail to decode MPEG system streams with a pack size larger than a CD-ROM sector size of 2324 bytes, even if the MPEG standard specification itself allows pack sizes up to 4096 bytes. So for the compatibility with such players set the system stream pack size less than or equal to 2324 bytes. The default value of pack size in the LSX-MPEG Encoder is 2048 bytes.


Special Property Page

LSX-MPEG Encoder

This dialog box prompts the user for information concerning skipping B frames to increase the image quality or frame rate. Options that can be chosen are Normal mode (default, no B frames skipped), Skip 1 B frame after I or P frame, Skip 2 B frames after and before I and P frame, and Skip all B frames.

These options may or may not affect image quality or frame rate; that can only be determined when they are used on a particular input data stream.

Select this link to display information on Encoding Files with Low Bitrates, which will give an explanation of the use of the choices here.


Constrained Property Page

LSX-MPEG Encoder

This dialog box asks the user to decide whether to use the default constrained parameters for encoding an MPEG-1 video file or not.

Checking this checkbox states to the program that you wish for the constrained parameters to be used in encoding your output. Selecting this option not only tells the application to check the file for constrained parameters but also places information in the header information of the MPEG file letting MPEG players know if the file was created using the constrained parameters or not.

Select this link for a more complete discussion of the Constrained Parameters.


Sync Property Page

LSX-MPEG Encoder

The Sync Parameters Property page has radio buttons that allow the user to choose to keep original duration time (default) or keep original number of frames. The default setting is restored if a new AVI file with audio is opened or if the audio option is selected.

If the user chooses to keep the original duration, the length of time a particular segment of the original AVI file will play for the same amount of time in the output MPEG file. This is called audio-video synchronization, and the user must choose to keep original duration when audio and video information must be synced. If there is no audio information to sync to the video, or if you choose not to include the audio of an AVI file into the output MPEG file, then you can choose to keep the original number of frames, which will encode the file as you have specified, but the playback duration of the file may be different from the original AVI file.


Running
  Running the LSX-MPEG Encoder

LSX-MPEG Encoder

Using the LSX-MPEG Encoder to make MPEG files

The program's main window consists of a top area for images and a bottom area for input and output file data. When the program is in the process of encoding, the top area is used to show currently encoded input and/or output video frames. If demonstration of both input and output streams is enabled, this window is split: the left window for the input video stream and the right window for the output MPEG video stream. If demonstration of only one video stream (input or output), is enabled, then the top area of the window contains an image of the current frame from that video stream. If demonstration of both input and output streams is disabled by the user, then the top window is empty.

Here is the main program window when the program is started. The bottom area of the main window contains dialog elements necessary to specify input and output files and some encoding parameters.

This dialog box displays the following information if it is available: frame format, frame rate, number of frames, playback duration, compression type, compression ratio, audio format, and audio frequency. This information is displayed when a new AVI file is opened and also when the "show AVI information" option is selected from the main view window.

When reporting the input AVI file properties, the program calculates compression ratio as a ratio between estimated size of uncompressed 24 bit/pixel RGB frame multiplied by the amount of input frames and the actual size of video stream data in the AVI file. The input file compression ratio calculated by this method may be approximate, and provided for user convenience only.

Here is an example view of the the program window during the encoding of a video file. The progress window in the middle shows values that reflect the encoding process. There is a progress bar representing what part of the file has already been encoded; below, text shows the current frame number, total number of frames to encode, and elapsed time (in seconds). Note that the number of frames to encode may not be the same as the number of frames in the input file.

If the user enables the calculation of quality value, then, as in the above picture of the main program window, the progress window will contain two bars representing the average quality of encoded video and image quality of the last encoded frame. The higher the quality of the picture, the more area is covered by the color indicator on those bars. To the left of the progress bars is a numerical value for the average quality parameter and current frame quality parameter. The highest possible value of quality parameters is 100, the lowest is 0.

When the video portion of a video and audio file is completed the following dialog will be displayed on the screen:

This dialog box displays information for number of frames encoded, output file size (bytes), encoding time, average image quality, minumum image quality, and compression ratio.

The program calculates the output MPEG file compression ratio as a ratio between the estimated size of the uncompressed 24 bit/pixel RGB frame multiplied by the amount of input frames ( not the amount of output frames; that can be different because of the frame rate conversion) and the actual size of the output MPEG video stream file.

It is after the video portion of the file has been encoded that the audio file is encoded if the option has been selected.

The following will be displayed as the audio information is being encoded:

Here is an example view of the the program window during the encoding of the audio portion of a file. The progress window in the middle shows values that reflect the percent completed and elapsed time. There is a progress bar representing what part of the file has already been encoded.

After the audio information has been encoded and multiplexed into the MPEG file the following dialog box will be displayed:

Here is an example of the final message box. It shows the output file size, video stream size, and audio stream size in Kbytes.

If an AVI file has both video (MPEG-2) and audio (MPEG-1 layer II) information to encode, the following dialog box will be displayed showing the output file size for each temporary file, video stream size and audio stream size.


Encoding a New File

LSX-MPEG Encoder

To begin encoding a new file, the user should specify input and output file names in the main program window. To do so, press the Browse button near the input file field. The standard Open File dialog box will appear.

Select the input AVI file to encode and press OK. If this is a valid AVI file and the system can read the header of the file, a small information message with parameters of this AVI file will appear. This dialog box displays the following information if it is available: frame format, frame rate, number of frames, playback duration, compression type, compression ratio, audio format, and audio frequency. If the specified file cannot be opened or is not a valid AVI file then an appropriate error message will appear. The input AVI file must have even width and height. If one of these values is not even, an error message will appear. The program will set parameters according to the data in the header of the selected AVI file. The program also will automatically set the default output file name and directory the same as the file name and directory of the input file, but with an  extension of .mpg or .m2v depending on the output file type specified (MPEG-1 or MPEG-2). At that point,  if everything is all right, the program is ready to begin MPEG compression. The Start button ( green arrow ) on the tool bar is activated. Press on this button to begin compression. You can also do so by selecting the Start encoding item in the Action menu.

If the program is not able to find a suitable video codec to read frames from the input AVI file, it will print the message Error: failed to decompress AVI video stream. Possible reason: cannot find appropriate codec.

To stop compression, press the Stop button. You can also do so by selecting the Stop encoding item in the Action menu. To suspend encoding, press the Pause button on the toolbar. To continue, press this button one more time. You can also do so by selecting the Pause encoding item in the Action menu.


Achieving Best Results

LSX-MPEG Encoder

To achieve the best results from encoding, the user has to find a set of parameters most adequate to the purposes of a particular task. There is no general rule on how to find the best combination of parameters. However, there can be some recommendations. The following section is based upon much experimentation by the developers using the LSX-MPEG Encoder. In no way can it be treated as a set of rules. These are examples of possible choices for parameter values in some possible situations.

Achieving Fastest Results

Achieving Best Picture Quality

Achieving Optimum Picture Quality and Performance

Achieving Very Low Bitrate


Achieving Fastest Encoding

LSX-MPEG Encoder

This section provides some recommendations on how to encode an MPEG file as fast as possible (but with acceptable quality). The following choices of parameters are suggested (in some cases the possible range of parameters are shown).

Maximum motion vectors

P frame maximum horizontal motion vector	16, 24, 32
P frame maximum vertical motion vector	8, 16

B frame maximum horizontal motion vector	8, 16, 24
B frame maximum vertical motion vector	8, 16

 Frames

In most cases, the default sequence of 3 P frames between I frames and 2 B frames between P frames gives fast encoding.

If you want faster encoding, reduce the amount of B frames because the encoding of B frames takes more time than P frames. Set one B frame between P frames.

Performance mode

Set "Fast" or "Very fast" performance mode. Tests show that even in "very fast mode", quality is often close to the best possible quality achieved in slow modes of operation. There is usually no significant subjective difference in image quality between files created in fast and slow modes of encoding. However, it may depend on a particular input video stream and other conditions of encoding.

Picture options

Drawing of input and output frames takes significant time during encoding. It is especially significant if you use a slow computer. Even a fast computer under Windows NT 3.51, because it has a slow graphics subsystem, will take more time to complete this process. This application has been optimized for true color modes (24 bit pixel values), use of other color modes may affect the speed and picture quality.

If you want faster encoding, disable drawing input and output frames. The only disadvantage is that you will not be able to control the process of encoding visually.

You should also disable calculation of image quality because it also takes time during encoding.


Achieving Best Picture Quality

LSX-MPEG Encoder

This section provides some recommendations on how to encode an MPEG file with the best possible picture quality. The following choice of parameters is suggested (in some cases a possible range of parameters is shown).

The video stream data rate is one of the main parameters affecting the output picture quality. So if picture quality is not satisfactory, increase the data rate, if it is acceptable for the particular application. The picture quality also depends on such encoding parameters as maximum motion vector values, frame sequence and performance mode. If the video stream data rate is limited and you cannot increase it, try to adjust other parameters.

There is no universal recommendation for the best choice of all these parameters. Test different MPEG encoding settings until the best possible image quality is obtained.

Maximum motion vectors

Optimum values of motion vectors depend upon the statistics of a particular input video file.

Here is a possible range of maximum motion vector values. To achieve the best results,  the user may need to encode with different values of maximum motion vectors.

P frame maximum horizontal motion vector	16, 24, 32, 40
P frame maximum vertical motion vector	16, 24, 32

B frame maximum horizontal motion vector	16, 24
B frame maximum vertical motion vector	16, 24

 Frames

Since encoded I frames are much larger than P and B frames and P frames are larger than B frames, you should increase the amount of P frames between I frames. Usually 3 or 5 P frames between I frames give good results if the data rate is limited. The optimum number of B frames is usually 2 or 3. If a very low data rate (8 Kbits/sec or less) is required, then sometimes  another choice of sequence parameters may help to achieve better results: One B frame between P frames and one P frame between I frames.

Select this link to see more about Encoding Files with Low Bitrates.

Performance mode

As was already mentioned in the section about performance parameters, theoretically, slow mode must provide better motion estimation and result in better quality. In practice, however, it is not always true. In some cases "slow" and "very slow" modes do not provide a significant gain in quality. It depends on the particular input video file. Try "Normal speed" and "Slow" modes.

Picture options

Picture options do not affect output MPEG file quality. You may want to enable show both input and output video streams to visually control the output file quality during encoding. It is often difficult to estimate visual changes in quality due to some changes in parameters. So you may want to enable the calculation of quality and use quality values to optimize encoding parameters.


Achieving Optimum Picture Quality and Performance

LSX-MPEG Encoder

This section provides some recommendations on how to encode MPEG files achieving optimum balance between picture quality and performance requirements.

Maximum motion vectors

P frame maximum horizontal motion vector	16, 24, 32
P frame maximum vertical motion vector	16, 24

B frame maximum horizontal motion vector	8, 16, 24
B frame maximum vertical motion vector	8, 16

 Frames

In most cases the default sequence of 3 P frames between I frames and 2 B frames between P frames gives fast encoding.

If you want faster encoding then reduce the amount of B frames, because encoding B frames takes more time than encoding P frames. Set 1 B frame between P frames.

Performance mode

Set "Normal speed" performance mode. Tests show that "Normal" mode quality is often very close to the best possible quality achieved in "Very slow" mode of operation. However, it may depend on a particular input video stream and other conditions of encoding.

Picture options

The process of drawing input and output frames takes significant time during encoding. If you want faster encoding, disable drawing input and output frames. The only disadvantage is that you will not be able to control the process of encoding visually.

You can also disable calculation of image quality because it also takes time during encoding.


  Glossary

LSX-MPEG Encoder

.m1v
.m2v
AVI files
B frame
codec
computer performance
concatenation
constrained parameters
data rate
encode
frame number
frame rate
high color video
I frame
image quality
low color video
macroblock
motion estimation
motion vectors (horizontal and vertical)
motion vector property page
MPEG-1
MPEG-2
multimedia
P frame
performance property page
picture area
picture property page
sequence property page
true color video
video stream


m1v
What is .m1v?

LSX-MPEG Encoder

M1V is the default file extension for MPEG-1 motion video files created by the LSX MPEG Encoder.


m2v
What is .m2v?

LSX-MPEG Encoder

M2V is the default file extension for MPEG-2 motion video files created by the LSX MPEG Encoder.


AVI file
What is an .avi file?

LSX-MPEG Encoder

An AVI file is the motion video file format used by Microsoft (tm) Video for Windows.


B Frame
What is a B Frame?

LSX-MPEG Encoder

A frame in an MPEG video stream coded by the interpolation of motion from the 2 nearest P or I frames (one previous and one next to the current B frame).


codec
What is a codec?

LSX-MPEG Encoder

A codec is a driver used in Microsoft (tm) Video for Windows that is capable of decoding (encoding) motion video with some specific kind of video compression. Some codecs are software only, and some may be hardware dependent, i.e. may require some particular hardware to be installed ( for example motion JPEG capturing board ).


computer performance
What is computer performance?

LSX-MPEG Encoder

Computer performance refers to the relative speed of a computer in performing particular tasks. A particular computer is said to have high performance if it can perform a certain task faster than other computers in its class.


concatenation
What is concatenation?

LSX-MPEG Encoder

The act of taking two separate files ( in this case video ) and splicing them together so that they make one file is called concatenation.


data rate
What is data rate?

LSX-MPEG Encoder

Data rate is the amount of data transferred by some information media in a unit of time.


encode
What does encode refer to?

LSX-MPEG Encoder

The process of reducing the size of data by means of some data compression algorithm.


frame number
What is a frame number?

LSX-MPEG Encoder

Refers to the sequence of frames in a video file. The first frame in the file would be called the first frame. The last frame in the file would be called the last frame, and all frames in between could be given a numerical value as to the number of frame in the file.


frame rate
What is frame rate?

LSX-MPEG Encoder

The default frequency of image frames in motion video.


high color video
What is high color video?

LSX-MPEG Encoder

In this manual: a display mode that provides color resolution of 15 or 16 bits per pixel.


I frame
What is an I frame?

LSX-MPEG Encoder

A frame in an MPEG video stream that is encoded without any reference to other frames.


image quality
What is image quality?

LSX-MPEG Encoder

In this manual: image quality is an objective or subjective measure of how different input video frames and encoded frames in the output MPEG file are. There are no assumptions about the quality of the input frame. In this program, measure of quality is based on the average sum of square values of differences of pixels on input and output frames. When applied to an input AVI file, the term quality is a measure of how much different the original captured video frames and video frames after encoding are.


low color video
What is low color video?

LSX-MPEG Encoder

In this manual: a display mode that provides color resolution of 8 bits per pixel or less.


macroblock
What is a macroblock?

LSX-MPEG Encoder

An element of an MPEG video stream that represents a minimum rectangle on an image with a standard size of 16 x 16.


motion estimation
What is motion estimation?

LSX-MPEG Encoder

A method of reducing the amount of data representing P or B frames in an MPEG video stream by means of searching for every macroblock on the current P or B frame that is most similar to a macroblock on previous and/or following P or I frames.


motion vectors
What is a motion vector (horizontal and vertical)?

LSX-MPEG Encoder

Values representing coordinates of macroblocks on previous and/or following I or P frames associated with a current macroblock as a result of motion estimation.


MPEG-1
What is MPEG-1?

LSX-MPEG Encoder

International standard on motion video and audio encoding ISO/IEC 11172.


MPEG-2
What is MPEG-2?

LSX-MPEG Encoder

International standard on motion video and audio encoding ISO/IEC 13818.


multimedia
What is multimedia?

LSX-MPEG Encoder

Multimedia refers to any of a group of hardware and software that relates to video and sound. Programs that can play or alter such information are called multimedia programs.


P frame
What is a P frame?

LSX-MPEG Encoder

A frame in an MPEG video stream that is encoded with reference to a previous I or P frame.


picture area
What is picture area?

LSX-MPEG Encoder

Picture area refers to the actual pixel area on the screen the image takes up. This can also be called the frame size.


true color video
What is true color video?

LSX-MPEG Encoder

In this manual: a display mode that provides color resolution of 24 or more bits per pixel.


video stream
What is a video stream?

LSX-MPEG Encoder

A portion of an MPEG file that represents motion video information. In this manual: that term also applies to an output MPEG file generated by the program, because the current version of the program cannot encode audio streams.


  Toolbar

LSX-MPEG Encoder

Here is the program toolbar. It contains several buttons. Some buttons are grayed out if they are not available in the current program mode of operation. Below is a description of the buttons, listed left to right.

Reset Profile Parameters	press this button to clear the current profile and set all
parameters to default settings.

Open Profile File	press this button to load a previously saved profile
file from disk.

Save Profile File	press this button to save all current parameters in
a profile file. It is active if the user selected input and output file
names or loaded a profile file from disk.

Start MPEG Encoding	press this button to start encoding. This button is not enabled
(grayed out) when the program is started. It will be activated
either when the user selects an input and output file name
or when the user loads an existing profile file from disk.

Stop MPEG Encoding	this button stops the process of encoding.

Pause MPEG Encoding	this button pauses the process of encoding.
To continue the encoding process, press this button one
more time.

Help Topics	this button will activate on-line help.


  Frequently Asked Questions

LSX-MPEG Encoder

General Encoder Questions

New User Questions

Experienced User Questions

How To

Error Message Explanations

Warning Message Explanations


General Encoder Questions

LSX-MPEG Encoder

What is LSX-MPEG Encoder?

The LSX-MPEG Encoder is a program that allows you to convert AVI format video files to MPEG files.

What are the advantages of the LSX-MPEG Encoder program over other software MPEG encoders?

The unique features of the LSX-MPEG Encoder program are:

1. MMX(tm) processor support for maximum speed of MPEG video encoding.

2. Special mode for creating very low data rate MPEG video files, which makes the program great for creating MPEG files for Web pages.

3. Simple and intuitive interface that is easy for new users and lets experienced users control a number of MPEG encoding parameters.

4. Revolutionary new motion estimation algorithm for fastest MPEG encoding. Due to this new algorithm, the LSX-MPEG Encoder works several times faster than other software MPEG encoding programs, while providing virtually the best possible compression quality.

What video compression formats in the input AVI video files are supported?

The LSX-MPEG Encoder reads input AVI files with almost any kind of video compression, including Indeo Video 3.2, Cinepac, Intel Video Interactive 4.1, Power! Video, Fractal FIF by Iterated Systems, Intel Video Raw (uncompressed YUV), YUV9, MJPEG, uncompressed RGB with 8, 16, 24, and 32 bit/pixel, and many others. In fact, the program will accept video frames from almost any input AVI file if your system has an appropriate AVI video codec installed and can play that AVI file. The program depends on Video for Windows capability to decompress particular video compression formats. If the program refuses to read the video stream from the AVI file, then you need to install an appropriate Video for Windows video codec.

What audio compression formats in the input AVI video files are supported?

The LSX-MPEG Encoder reads audio streams from input AVI files with uncompressed PCM audio format, 8 or 16 bits/sample, mono or stereo, and sample frequency 44100, 22050 or 11025 Hz. This covers most audio formats used in AVI files. If the LSX-MPEG Encoder cannot accept an audio compression format, it is still able to compress the video stream. If the program cannot accept an audio compression format and audio compression is required, the AVI file audio format can be easily changed to one of the standard acceptable audio formats by using any second party video editing program.

What output files can it create?

The LSX-MPEG-Encoder can create MPEG-1 and MPEG-2 video streams. It can create MPEG-1 Level II audio stream files, both mono and stereo. It also can create MPEG-1 system stream files with multiplexed video and audio streams.

Who should use the LSX-MPEG Encoder?

Anyone who wants to create MPEG files on a personal computer. It is the fastest and most flexible software MPEG encoder available today. On new personal computers with an Intel MMX(tm) technology processor, this program works as fast as some low-end hardware MPEG encoding boards for a fraction of their cost.

1. It may be used for multimedia CD production, improving the appearance of game and educational program titles.

2. It may be used for creating libraries and databases of digitized video clips.

3. It may be used to make compressed video files for Internet Web pages. The LSX-MPEG Encoder has a unique mode for creating MPEG files with very low data rates. This is especially attractive for Internet applications.

4. It may be used by home users and digital video hobbyists to reduce disk space occupied by video files.

5. It also may be useful for students and teachers to study digital video compression and do many experiments with different encoding options supported by this program.

What is MPEG?

MPEG-1 and MPEG-2 are international standards for encoding digital video information. They are created by the Moving Picture Coding Experts Group (MPEG) of the Joint ISO/IEC Technical Committee (JTC 1) on Information Technology. MPEG-1 is formally known as ISO/IEC 11172 and MPEG-2 is formally known as ISO/IEC 13818.

1. MPEG-1 is suitable for low and medium data rate applications producing image quality comparable to VCR data. Such applications include computer multimedia CD-ROM titles, computer games, video training materials, databases of digitized video clips, and interactive video on Internet pages.

2. MPEG-2 is designed for high quality video applications like digital satellite TV or DVD, a new generation of compact disc capable of playing back at a higher data rate and for a longer time than standard CDs.

This standard creates an opportunity for a common approach to any application of digitized compressed video. The field of using MPEG covers such applications as multimedia, CD production and technology, digital video broadcast, storage of digitized video databases, computer games, education programs, digital video production, video on demand, and may others. MPEG files are becoming a common media for storing and interchanging digitized video on the Internet.

What are the advantages of storing digitized video in MPEG format over the other known video compression file formats like AVI, QuickTime, MJPEG etc.?

MPEG-1 and MPEG-2 are international standards. The MPEG files are system independent unlike system specific video file formats such as AVI and QuickTime. MPEG files can be played by many different software and hardware players on different systems. There are many free programs for playing MPEG-1 files, as well as inexpensive hardware video boards with hardware support for MPEG-1 file playback available on the market. In most cases, MPEG provides better quality video encoding with limited data rate than AVI, QuickTime, MJPEG, or other file formats. Or for the same video encoding quality, MPEG files may be significantly smaller in size. For many applications the best way of storing digitized video is to capture analog input video to an AVI file using an inexpensive video capturing card on a personal computer, optionally edit the AVI video file, and then convert the AVI file to MPEG using our LSX-MPEG Encoder.

How does the LSX-MPEG Encoder change the process of creating MPEG files for thousands of users?

A drawback of using the MPEG compression standard is that real time MPEG capturing systems are very expensive. MPEG files are difficult to edit and special MPEG editing systems are also very expensive. The first software MPEG encoders were very slow at converting input video files to MPEG at speeds of less that one frame per second. This made creating MPEG files not very practical. Now the situation has changed due to the introduction of newer and faster processors in personal computers. These faster systems, along with our new LSX-MPEG Encoder, allow you to create MPEG video files at the same speed of some hardware encoders for a fraction of the cost. By using the LSX-MPEG Encoder on processors with MMX technology, maximum video encoding speed can be obtained.

What is MMX and what does it do for MPEG encoding?

MMX is a new media enhancement technology  introduced in Intel's most recent processors. More powerful processors with MMX technology are expected to hit the market in the near future. The instruction set of Intel's processors is extended by 57 new powerful instructions specifically designed for manipulating and processing video, audio, and graphical data more efficiently. These instruction sets are oriented to the parallel, repetitive sequences often found in multimedia operations. The MMX instructions can operate simultaneously, improving the speed of many multimedia applications by several times.

But, this new and exciting capability of processors with MMX technology can't improve the speed of most existing programs. The program is specifically designed to fully take advantage of this new technology. The LSX-MPEG Encoder is one of the first programs for digital video production that fully utilizes this advantage in processors with MMX technology. When the program is started, it automatically recognizes if the processor has Intel MMX technology and uses MMX instructions for the maximum encoding speed of MPEG video streams.

What speed gain is obtained by using MMX technology with the LSX-MPEG Encoder?

According to our tests, using MMX technology increases speed 2 to 3 times faster for MPEG video compression.

Can users without MMX processors use the LSX-MPEG Encoder?

The LSX-MPEG Encoder program does not require an MMX processor. If the computer has MMX capability, the program will recognize and use it. The output MPEG file will be exactly the same, with or without MMX processor support . The only difference will be in the speed of encoding. Even without MMX technology, the LSX-MPEG Encoder compresses video streams faster than other software MPEG encoders.

Can I turn off the MMX intstruction support when running the LSX-MPEG Encoder?

Yes. The MMX instructions within the LSX-MPEG Encoder can be turned off by adding to the command line of the LSX-MPEG Encoders' execution command line the following /notmmx, which will tell the LSX-MPEG Encoder to not use the MMX instructions during the encoding of your files.


New User Questions

LSX-MPEG Encoder

There are many complicated parameters in the "Advanced" dialog box. Do I need to specify all of these parameters to correct values before I start encoding an MPEG file?

No. When the program is started and a new input AVI file is selected, the program will set all advanced parameters by predetermined default values. These values are acceptable in many cases and may be a good starting point. In the main dialog window, just set what kind of output file is required (MPEG-1 or MPEG-2), with audio or without and what frame rate and data rate should be in the output file.

When selecting a new input AVI file name, the program sets the same name and directory for the output file with the extension *.mpg or *.m1v ( *.m2v for MPEG-2). Make sure the output file name and directory are acceptable and correct, if necessary. Make sure you have a sufficient amount of free space on your hard drive for the output MPEG file. Now you are ready to start encoding. Start with the default program settings and encode the video file. Play the output MPEG video file. If you are not fully satisfied with the output video quality, change some parameters in the advanced properties dialog windows and encode the MPEG file again.

I created an MPEG video file. How can I play it?

At this time, we do not offer an MPEG player with the LSX-MPEG Encoder. Different users may prefer different MPEG players or you may already have a software or hardware MPEG player. Following is a list of recommended MPEG players on the market:

1. REALMagic Maxima Pro - hardware

2. SoftPEG version 2.2 - software

3. ActiveMovie from Microsoft - software

4. InterVU plug-in from InterVU Inc. - Netscape plugin

What should I do if I created an MPEG file using the LSX-MPEG Encoder and it does not play on my favorite MPEG player?

Although the output MPEG files created by the LSX-MPEG Encoder are compliant with MPEG standard specifications, most MPEG players can only play MPEG files that are within a limited subset of encoding parameters. Most free software and low-cost hardware MPEG players play only MPEG-1 files that are within the constrained parameters (see program documentation or HELP file for the definition of constrained parameters). It is a good idea to create MPEG-1 files that are compliant with constrained parameters when possible. There may be other limitations with different players. See the particular MPEG player documentation for more information.

See also LSX-MPEG Encoder program documentation or HELP file for more information on how to ensure maximum compatibility of the output files. If all possible measures to change encoding parameters do not help, install another MPEG player.

What should I do if I created an MPEG file using the LSX-MPEG Encoder and the picture quality is not good enough?

The LSX-MPEG Encoder allows you to set many different encoding parameters that affect picture quality. The most significant parameter is the video stream data rate. Increase the data rate if it is suitable for your application. If you are trying to achieve the best possible picture quality for a particular fixed data rate, see the paragraph "How to achieve the best possible quality of output video file". See the program documentation or HELP file for more information.

It is also possible that your MPEG player caused the low picture quality during playback. See the paragraph "I created an MPEG video file. How can I play this file now" for MPEG player recommendations.  Some MPEG players allow you to set playback quality options depending on the system capabilities.

What should I do if I created an MPEG file using the LSX-MPEG Encoder and the quality of the audio is not good enough?

The LSX-MPEG Encoder allows you to set several audio encoding parameters that affect sound quality. These parameters are selected from the "Audio" property page in the "Advanced" parameters window. The most significant parameter is the audio stream data rate. The default audio data rate is  64 Kbits/sec for mono and 128 Kbits/sec for stereo sound. The maximum available audio data rate is 192 Kbits/sec for mono and 384 Kbits/sec for stereo sound. If the input AVI file has a mono audio stream, then the output MPEG file also has mono audio. If the input file has a stereo audio stream, then the output MPEG file may have one of 3 possible encoding modes; stereo, dual, or joint stereo mode. The stereo mode is preferable for best sound quality with high data rates. The joint stereo mode may improve sound quality on low data rates.

It is also possible that your MPEG player caused the low audio decoding quality during playback. Some MPEG players allow you to set the audio quality options depending on the system capabilities. Usually software MPEG players use low audio decoding quality options by default. If you have a fast system (a Pentium 120 MHz processor or higher), then you may be able to set a higher quality audio decoding option for your player.

What should I do if the input file frame rate is different from any of the output MPEG file frame rates listed in the main program window?

The MPEG standard specifies the following frame rates: 23.976, 24, 25, 29.97, 30, 50, 59.94, and 60 frames/sec. There is no support for other frame rates. Currently, the LSX-MPEG Encoder supports the following frame rates 23.976, 24, 25, 29.97, and 30 frames/sec. If your input AVI file has one of the frame rates in this list, then just set the same frame rate for the output MPEG file. If the input AVI file has one of the frame rates in the list, you may still need to create an MPEG file with a different frame rate. The frame rate conversion procedure will be applied as described below.

The LSX-MPEG Encoder has 2 different modes of frame rate conversion to encode files with frame rates different from the frame rates in the input file. The first option is to keep the original playback time the same as the input file. This is the default mode and is the only available option when encoding video and audio. In this mode, the program may duplicate or skip some input video frames to ensure proper synchronization. The second option is to keep the original frame sequence. In this case the playback time and speed of the output MPEG file will be different from the original. Both of these options are available when compressing video streams without audio. This option can be selected from the "Sync" property dialog window in the "Advanced" dialog box. When the user opens a "new" AVI file and the new file has an audio stream, the default option is selected automatically.

Can I preview input AVI and output MPEG files from the LSX-MPEG Encoder?

Yes. You can preview input and output video files if you are using Windows 95 or Windows NT 4.0. When you press the "Browse" button to select an input AVI file, the input file name dialog box appears. Click the right mouse button on any AVI file name in the file list window. A pop-up menu will appear with items like "Select", "Play", "Open" etc. Choose the "Play" option to start playing immediately or the "Open" option to create a play window. The playback window should come on the screen. You may play the video file in that window. Please note that currently most software and low-end hardware MPEG  players can’t play MPEG-2 files. This simple playback functionality depends on the systems ability to play the specified AVI and MPEG video files and may not function if an MPEG player is not installed on the system.

I am encoding an MPEG-1 file and often change the video (audio) encoding or multiplexing parameters without changing the audio (video) parameters.  Can I skip a step in the video (audio) stream encoding every time?

Yes. The LSX-MPEG Encoder creates output MPEG files in 3 steps; 1) Encodes the video stream to a temporary file, 2) Encodes the audio stream to a temporary file, and 3) Multiplexes the video and audio into a system stream in the output file. The program allows you to skip the 1st and/or 2nd step of encoding if the video or audio stream file already exists. To use this option with an existing video (audio) stream file, the temporary file name in the "Files" property page must be the same as the existing file. If you do not want the temporary file with the video or audio stream to be deleted after the encoding (default mode), then disable this option in the ‘Files" property page. When encoding with the existing audio or video stream temporary file, answer "No" on the warning message to skip the encoding of this video (audio) stream and use the existing file. Note: You may set the temporary file name to any filename.

I am encoding an MPEG file and the number of frames in the output file is different from the number of input video frames. Why?

 The number of output video frames will be different from the number of input video frames if the frame rate in the output MPEG file is different from the input frame rate. In the default encoding mode ("keep original duration"), the program may duplicate or skip some input frames to ensure proper playback time and audio synchronization. If only the video stream is compressed (no audio), then you may choose the other mode ("keep original number of frames") in the "Sync" property page of  the "Advanced" dialog window.

I encoded an MPEG file using LSX-MPEG Encoder and the output file size is larger than the input AVI file size. Why?

The size of the output file depends on the specified data rate. To reduce the size of the output file simply reduce the specified video and audio stream data rate. The video stream data rate is specified in the main program window (in the amount of Kbytes/sec), and the audio stream data rate is specified in the "Audio" property page of the "Advanced" dialog window (in the amount of Kbits/sec). The data rate is the main parameter affecting the output picture quality. If the selected data rate is too low for a particular video file, the picture quality may be reduced. If you need to create very small MPEG files, see the chapter "How to encode MPEG files with very low data rates?" in this FAQ.

I see only a fraction of the input and output video frames in the program window during the video encoding. Can the program scale the images up or down to the maximum extent of the window area?

The program has 2 modes of picture drawing; with or without scale. The default mode is to draw pictures without scale. In this mode, the program shows the largest image area possible. If the picture is larger than the window area, the program will crop the central portion of the image area. The program does not scroll (move) pictures inside the window. To be able to see the entire picture try to enlarge the main program window.

The second drawing mode is to scale images up or down to the maximum extent of the image window. The program will try to keep the aspect ratio of the original picture. To set this mode click on the item "Scale images to window" or simply press "Ctrl-W". A checkmark will appear beside the menu item to show that the scaling mode is activated. This mode may be useful when compressing files with very large image sizes to see the whole image area or when compressing files with very small image sizes to enlarge the small details on the picture. The disadvantage of using the scaling mode is that it may significantly reduce program performance due to the extra time required for image scaling operations.

What is the definition of compression ratio that the program reports for input and output files?

When reporting the input AVI file properties, the program calculates compression ratio as a ratio between the estimated size of an uncompressed 24 bit/pixel RGB frame, multiplied by the number of input frames and the actual size of video stream data in the AVI file. The input file compression ratio calculated this way may be approximate, and is provided only for the user’s convenience.

The program  calculates output MPEG file compression ratios as a ratio between the estimated size of an uncompressed 24 bit/pixel RGB frame, multiplied by the number of input frames (not the amount of output frames, which can be different due to the frame rate conversion) and the actual size of the output MPEG video stream file.

What formula was used for the calculation of picture quality that the program reports ?

The quality measure is based on mean square error (MSE) value, measured in YUV 411 color space between input and encoded frames. For the user’s convenience, we scale this value to the intuitive range from 0% to 100% using a nonlinear function. A value of 100% corresponds to the maximum possible quality, i.e. MSE=0. This quality measure does not relate to any standard and is provided  for the user’s convenience.

I know that the program takes input AVI files and creates output MPEG files. What is the profile file?

The profile file is a convenient way to store all MPEG encoding parameters. Profile files (*.PRF) may be used to save frequently used sets of parameters. It is stored with all the program status information, including input and output file names, viewing options, etc. To use a parameter set from a parameter file, open the profile file using the "Open profile file" menu option. Click on the "Browse" button near the "Input file" dialog item to select a new input file. The program will get the frame width and height from the input AVI file. The program will also determine if the input file has an audio stream.  If it does, then it will set the audio encoding option to "ON" by default. All other encoding parameters are kept the same. If you changed an encoding option, the program will ask if you want to save the parameter file upon exiting or loading a new parameter file.


Experienced User Questions

LSX-MPEG Encoder

What is a skip frame mode and when should I use it?

A special set of skip frame modes is available with the LSX-MPEG Encoder. These are designed to help create MPEG files with very low data rates. Using skip frames may also help to increase picture quality of the output MPEG file when the input AVI file has a frame rate lower than any of the standard MPEG frame rates.

The MPEG standard specifies the following frame rates:  23.976, 24, 25, 29.97, 30, 50, 59.94, and 60 frames/sec. There is no provision in the standard for support of frame rates lower than 23.976 frames/sec. The LSX-MPEG Encoder program can create MPEG files with frame rates:  23.976, 24, 25, 29.97  and 30 frames/sec. Input AVI files may have a frame rate that does not match any of the available MPEG frame rates. In this case, the program may duplicate or skip frames to keep proper synchronization and playback duration. AVI files often have frame rates less than 15 frames/sec. When encoding from AVI files such as these, most of the input frames will be duplicated to obtain one of the standard MPEG frame rates. Skip frame mode may help to avoid the encoding of duplicated frames. It also helps to reduce the visible frame rate for the files with a very low data rate.

It is often acceptable to sacrifice visible frame rate for a better visible picture quality. There is a way to reduce visible frame rate by creating special "skip" frames. There are 4 options in the "Special" property page to control skipped frames: "normal mode" (do not skip), "skip 1 B frame", "skip 2 B frames", "skip all B frames". The default is "normal mode", which disables frame skipping. Other options specify how many B frames in a subgroup sequence will be skipped. The skipped B frame is essentially a B frame with no picture change information. When decoded by a standard MPEG player, the skipped B frames will repeat the picture from the nearest P frame in the sequence.

The effect of using skipped frames depends on the specified sequence settings.

Example 1:

Assume that the input AVI file has a frame rate equal to 12 frames/sec and the output MPEG file has a frame rate of 24 frames/sec. In this case, all frames in the output file will be duplicated. There is no reason to encode information for duplicated frames. Let us show how the skipped frames may help to avoid duplicate frames and what the recommended sequence options are in this case. We can set the frame sequence with 3 B frames in the subgroup ( IBBBPBBBP.. ). Set the option "skip 2 B frames".  It allows skipping 2 of every 3 B frames. This will effectively reduce the visible frame rate by 2 times, so the visible frame rate will be 12 frames/sec, which is equal to the input file frame rate.

The same visible frame rate of 12 frames/sec can be alternatively achieved by specifying a sequence with 1 B frame (IBPBPBP.) and selecting the option "skip 1 B frame" (or any larger skip option). The same sequence and skip settings will help to reduce the visible frame rate by 2 times relative to the output MPEG file frame rate even if the input file has any other frame rate value.

Example 2:

Assume that the input AVI file has a frame rate equal to 10 frames/sec and the output MPEG file a frame rate of 29.97 frames/sec. In this case all frames in the output file will be repeated 2 or 3 times. There is no reason to encode information for repeated frames. Let us show how the skipped frames may help to avoid duplicate frames and what the recommended sequence options in this case are.

We can set the frame sequence with 3 B frames in subgroup (IBBBBBPBBBBBP..). Set the option "skip all B frames". This will effectively reduce the visible frame rate by 3 times, so the visible frame rate will be about 10 frames/sec, which is equal to the input file frame rate. The same sequence and skip settings will help to reduce the visible frame rate by 3 times relative to the output MPEG file frame rate even if the input file has any other frame rate value. We are trying to skip 1/3 of all frames to achieve a very low data rate with reasonable picture quality. It is possible to achieve an even lower visible frame rate by setting "skip all B frames" and increasing the number of B frames in the sequence. For example, a setting of  "Skip all B frames", frame rate equal to 25 frames/sec, and 5 B frames, 3 P frames in the sequence, will effectively result in a visible frame rate of 5 frames/sec. This may be sufficient for some low data rate applications. In some special video applications, like multimedia presentations or training materials it could be acceptable to reduce the visible frame rate even more. The program allows a maximum setting of 30 B frames in the sequence. In combination with  the special "Skip all B frames" mode, it theoretically allows a visible frame rate less than 1 frame/sec. There is always some reasonable number of a skipped frame that provides good picture quality and an acceptable visible frame rate.

Note: The files with skipped frames are compliant with the MPEG standard specification. Nevertheless, some MPEG players, for example Microsoft ActiveMovie 1.0, fail to play MPEG-1 files with skipped frames. So, if the maximum system compatibility with any player is required, use of skip frames is not recommended.


How To

LSX-MPEG Encoder

How to create MPEG file

First, you need to create input video material in the form of an AVI video file. It may be created from analog video input using any video capturing board that is capable of creating an AVI file. Note that the quality of the compressed output MPEG file will depend on the quality and level of noise in the AVI video file. So for best results, a good image in the AVI file is essential. We recommend using video capturing cards that make AVI files with motion JPEG (MJPEG) compression, using as high a data rate as the particular capturing card allows.

Input video material can also be created by some video animation software. In this case we recommend storing AVI video files with no compression (24 bits/pixel RGB format) for maximum image quality.

The intermediate stage of video editing may be required to create a final video sequence. Users may use any video editing program like Microsoft VidEdit, or more advanced products like Adobe Premiere. When creating intermediate video files with editing programs, it is recommended that you store the AVI file with no compression for maximum image quality.

The final step is to convert the AVI video file to an MPEG file using the LSX-MPEG Encoder. You can select the full input file or a fraction of the input file (starting from frame N for a total of M frames) to be encoded.

The MPEG encoding itself is a creative process. The MPEG standards are very flexible, allowing many possible encoding options. The LSX-MPEG Encoder provides an opportunity for specifying many different encoding options in the advanced properties dialog windows. Start with the simple default program settings and encode the video file the first time. Play the output MPEG video file. If you are not fully satisfied with the video quality, change some parameters in the property pages of  the "Advanced" dialog window and try to encode the MPEG file again.

How to achieve the best possible quality of an output video file

The video stream data rate is the main parameter affecting the output picture quality. So if picture quality is not satisfactory, increase the data rate, if it is acceptable for the particular application. The picture quality also depends on such encoding parameters as maximum motion vector values, frame sequence, and performance mode. If the video stream data rate is limited and you can’t increase it, try to adjust other parameters listed above.

There is no universal recommendation for the best choice of all the parameters. Try to test different MPEG encoding settings until the best possible image quality is obtained. Choosing optimum maximum motion vector values is complicated and depends on motion activity in the particular source video. The maximum motion vectors should be long enough to cover the maximum visible object motion on the screen. Usually the P frame motion vectors must be longer because they should cover the maximum visible object motion between the nearest P frames. The interval between P frames depends on frame sequence settings (it is equal to the specified amount of B frames in a subgroup). The B frame motion vectors may be shorter, but they should cover the maximum visible object motion between the current B frame and nearest P (I) frames. The motion vectors must be longer in the direction of most probable object motion. Usually you may set maximum horizontal motion vector values slightly larger than vertical and P frame motion vectors larger than the same values for B frame.

Motion vectors that are too long may not improve picture quality. In fact, motion vectors that are too long may even reduce quality especially for a low data rate, because long motion vectors encoding takes more bits and less bits are left for the picture coding itself. Start with the default settings and try to adjust maximum motion vector values until the best possible quality is obtained. Note that when you modify the settings of the frame sequence or program performance mode, you may need to adjust motion vectors.

Frame sequence also affects image quality. Usually the default setting of 3 P frames 2 B frames (IBBPBBPBBPBBI) gives good results. But in some cases modification of the frame sequence may help to improve picture quality.

The LSX-MPEG Encoder program has 5 performance modes from very fast to very slow. Usually the "normal" speed mode provides good picture quality. Reducing encoding speed to "slow" and "very slow" modes may or may not improve picture quality for some particular encoding conditions.

How to achieve the fastest possible video compression

To achieve the fastest MPEG video encoding, set "very fast" encoding mode in the "Performance" property page and reduce the maximum motion vector values in the "Motion vectors" property page of the "Advanced" dialog window.

Another measure that can speed up the MPEG video encoding is disabling all unnecessary operations: drawing input and output pictures and quality calculations in the "Picture" property page of the "Advanced" dialog window.

How to encode MPEG files with very low data rates

It is usually not possible to transmit a video sequence with a high frame rate and high image quality with the very low data rates suitable for modem communication over telephone lines. It is often acceptable to sacrifice visible frame rate but keep better visible picture quality. There is a way to reduce visible frame rate by creating special "skip" frames which are essentially B frames with no picture change information. When a file with skipped frames is being played by a standard MPEG player, these frames repeat the picture of the nearest P frame. The use of skipped frames allows the encoder to allocate more bits of data for encoding of other non-skipped frames, improving visible picture quality. See the paragraph "What is a skip frame mode and when should I use it?" in the Q&A file or appropriate chapters in the program documentation or HELP file for more information on how to use skipped frames.

How to ensure maximum possible compatibility of the output MPEG file with different hardware and software MPEG players

The output MPEG files created by the LSX-MPEG Encoder are compliant with the MPEG standard specification, but most MPEG players can play only those MPEG files that are within some limited subset of encoding parameters. Most free software and low cost hardware MPEG players play only constrained-parameters MPEG-1 files (see program documentation or HELP file for the definition of constrained parameters). It is a good idea to try to create only MPEG-1 files that are compliant with the constrained parameters whenever possible. There could be some other limitations for different players.

For example, some hardware players fail to play MPEG files if frame sizes (width and height) are not a multiple of 16. The MPEG standard specification itself does not have any limitation on possible width and height values other than a value less than some particular maximum value. The LSX-MPEG Encoder can accept AVI files and create MPEG files with any even value of frame width and height. But taking into account the problem with some players mentioned above, it may be a good idea to create files with a frame width and height that is a multiple of 16, for example 320 x 240 or 160 x 112.

Some hardware MPEG players fail to decode MPEG system streams with a pack size larger than a CD-ROM sector size of 2324 bytes, even though the MPEG standard specification itself allows pack sizes up to 4096 bytes. So for compatibility with such players, set the system stream pack size less than or equal to 2324 bytes. The default value of the pack size in the LSX-MPEG Encoder is 2048 bytes.

The MPEG player in Microsoft ActiveMovie sometimes does not play very low data rate MPEG files (less or equal 4 Kbytes/sec) and sometimes does not decode a file with skipped frames, despite such files being consistent with the MPEG encoding standard. So for compatibility with Microsoft ActiveMovie, do not use skipped frames and do not create MPEG files with data rates less than approximately 4 Kbytes/sec.


Error Message Explanations

LSX-MPEG Encoder

Error ...		Explanation ...
Error: Output directory "..." does not exist or not available. Please set valid output file name or directory. Temporary file names will be changed according to new output name.		This error message may appear if the user selects a new output file name that the system cannot create. Possible reason: The specified directory does not exist. The output file must be specified in an existing directory. If you need to specify the output file in a new directory, create a new directory before setting a new file name. Press OK to continue. The output file name dialog box should appear. Select the correct output file name in this dialog box.The temporary file names for video and audio streams are assigned based on the specified directory and output file name. You may change the temporary file names in the  "Files" property page.
Error: Output file "..." can’t be created. Possible reason: device is a network drive that does not support long file names or available for read only access. Would you like to specify another temporary file name?		This error message may appear when the user selects a new output file name or after the user selects a new input file name. The temporary file names for video and audio streams are assigned based on their specified output file name and directory. The system cannot create a temporary file. Possible reason: the temporary file is being created on a network drive and the specified drive does not support long file names or file names containing illegal characters. Press Yes to continue. The output file name dialog box should appear. Select the correct output file name in this dialog box.
Error: Output device or directory"..." is read only. Please set valid output file name. Temporary file names will be changed according to new output file name.		This error message may appear when the user selects a new output file name or after the user selects a new input file name. The temporary file names for video and audio streams are assigned based on their specified output file name and directory. The system cannot create the specified output file because it is located on a read only CD-ROM drive. This error message commonly appears when the user selects an input AVI file from a CD-ROM drive. Press OK to continue. The output file name dialog box should appear. Select the correct output file name in this dialog box.
Error: temporary audio(video) file ".." can’t be created. Possible reason: device is a network drive that does not support long file names or available for read only access. Would you like to specify another temporary file name?		This error message may appear when the user selects a new output file name or new temporary file name. The temporary file names for video and audio streams are assigned based on the specified output file name and directory. The system cannot create a temporary file. Possible reason: the temporary file is being created on a network drive and the specified drive does not support long file names or file names containing illegal characters, or device does not have write access permissions. Press Yes to continue. The temporary file name dialog box should appear. Select a different temporary file name(s) or directory in this dialog box.
Error: file name "..." already exists and does not have write permission. Would you like to specify another output file name?		This error message may appear when the user selects a new output file name that already exists and has read only access permissions. Press Yes to continue. The output file name dialog box should appear. Select the correct output file name in this dialog box. Alternatively you may prefer using the File Manager or some other system tool to change access permissions of the specified file if it is possible.
Fatal error during multiplexing: cannot open file "..." for write operation. Permission denied. File or device is read only.		This error message may appear during MPEG encoding when the program cannot create the output file. The directory or device may have read only permission. Press "OK" to continue.  Open the "Output file" dialog box and specify a different  output file name or directory.
Error: Couldn’t create output video (audio) file "..." Permission denied. File name is incorrect or file is read only. Possible reason: network drive does not support long file names or device is a read only network drive.		This error message may appear during MPEG encoding when the program cannot create the output file. The file name may contain illegal characters, network device may not support long file names, or directory or device may have read only permission. Press "OK" to continue. Open the "Output file" dialog box or the "Files" property page in the "Advanced" dialog box (if this is a temporary file) and specify the correct output or temporary file name.
Error: Couldn’t create output video (audio) file "..." Illegal directory or file name. Please set valid drive letter, directory and file name.		This error message may appear during MPEG encoding when the program cannot create the output file. Press "OK" to continue. Open the "Output file" dialog box or open the "Files" property page in the "Advanced" dialog box (if this is a temporary file) and specify the correct output (or temporary) file name.
Error: Maximum P frame horizontal (vertical) motion vector must be positive, multiple of 8. Please correct maximum horizontal motion vector.		This error message may appear when the user specifies a new value of maximum motion vectors for P frames. The maximum motion vector must be a positive integer value, multiple of 8. Press "OK" to continue. The "Advanced" parameters window will appear again. Set the correct values of motion vectors within the allowed limitations.
Error: Maximum B frame horizontal (vertical) motion vector must be positive, multiple of 8. Please correct maximum horizontal motion vector.		This error message may appear when the user specifies a new value of maximum motion vectors for B frames. Maximum motion vectors must be a positive integer value, multiple of 8. Press "OK" to continue. The "Advanced" parameters window will appear again. Set the correct values of motion vectors within the allowed limitations.
Error: Illegal number of input frames <1. Please set correct number of frames to encode.		This error message may appear when the user specifies an incorrect number of frames to encode in the main parameters window. Possible reason: the specified number is negative or an incorrect character has been entered. Set the correct number of frames to encode and try again.
Error: The first frame number is greater than the number of frames in the input file. Valid 1st frame number must be from 0 to ... please correct first frame number.		This error message may appear when the user specifies an incorrect number for first frame in the main parameters window. The maximum first frame number must equal the (number of frames in the input file) -1. Set the correct number for the first frame to encode within the allowed limits and try again.
Error: The last frame (first frame + number of frames to encode) is greater than the number of frames in the input file. There are a maximum of 196 frames.		This error message may appear when the user specifies an incorrect number of frames to encode in the main parameters window. The number of the first frame plus the number of frames to encode must be less than or equal to the number of frames in the input file. Set the correct number of frames to encode and try again.
Constrained parameters error: Encoding parameters for the MPEG video stream do not satisfy constrained parameters specification: [description of particular error, example 1] image area > 396 macroblocks (W*H>101376, where W and H are width and height rounded up to the nearest multiple of 16). The program cannot encode an MPEG-1 constrained parameters video stream with these parameters. Open the "Advanced" property sheet and disable the "constrained parameters" option in the "Constrained" property page or change some video stream parameters before encoding. Warning: Some MPEG-1 players may not be able to play MPEG video streams that do not satisfy the constrained parameters specification.		This error message appears when the user specifies encoding parameters that do not satisfy the constrained parameters specification. Constrained parameters are defined in the standard specification as a subset of the MPEG-1 video stream encoding parameters that most MPEG-1 players should (but are not guaranteed to) support. See program documentation or HELP file for more information about constrained parameters. This particular error appears because the frame Width * Height is larger than the maximum value specified by constrained parameters. The LSX-MPEG Encoder can create MPEG-1 files with parameters that exceed the limitations of constrained parameters. To enable this feature you should disable the "constrained parameters" option in the "Constrained" property page. Note: most of the software MPEG players and low-end hardware players will not play MPEG files if some parameters exceed the limitation of constrained parameters. Try to stay within constrained parameters when possible.
Constrained parameters error: Encoding parameters for the MPEG video stream do not satisfy constrained parameters specification: [description of particular error, example 2]video stream data rate > 1856000 bits/sec (approximately equals to 226 Kbytes/sec). The program cannot encode MPEG-1 constrained parameters video stream with these parameters. Open the "Advanced" property sheet and disable the "constrained parameters" option in the "Constrained" property page or change some video stream parameters before encoding. Warning: Some MPEG-1 players may not be able to play MPEG video streams that do not satisfy the constrained parameters specification.		This error message appears when the user specifies encoding parameters that do not satisfy the constrained parameters specification. Constrained parameters are defined in the standard specification as a subset of the MPEG-1 video stream encoding parameters that most MPEG-1 players should (but are not guaranteed to) support. See program documentation or HELP file for more information about constrained parameters. This particular error appears because the specified video stream data rate exceeds the constrained parameters limit. The LSX-MPEG Encoder can create MPEG-1 files with parameters that exceed the limitations of constrained parameters. To enable this feature, you should disable the "constrained parameters" option in the "Constrained" property page or you can reduce the specified data rate to the maximum value 226 Kbytes/sec allowed by the constrained parameters specification. Note: most of the software MPEG players and low-end hardware players will not play MPEG files if some parameters exceed the limitation of constrained parameters. Try to stay within the constrained parameters when possible.


Warning Message Explanations

LSX-MPEG Encoder

Warning ...		Explanation ...
Warning: Output file "..." already exists. Would you like to specify another output file name?		This warning message may appear when the user selects a new output file name that already exists. Press "Yes" to continue. The output file name dialog box should appear. Enter another output file name in this dialog box or press "No" if you wish to overwrite the existing file.
Warning: temporary video (audio) file "..." is located on network drive. Device may slow down the encoding process. Would you like to specify another temporary file name or location?		This warning message may appear when the user selects a new output or temporary file name with the temporary files being located on a network drive. The network access may be slower than the access to a local hard drive, so it is recommended that you locate temporary files on a local drive if it has sufficient free space. Press "Yes" to continue. The temporary file name dialog box should appear. Enter another temporary file name(s) in this dialog box or press "No" if you wish to keep the temporary files on a network drive.
Warning: New temporary file name(s) has not been selected. Do you wish to cancel temporary file name testing?		This warning message may appear when the user has an error or warning related to the incorrect selection of temporary file names and did not change the temporary file name in the appropriate dialog box. The user may intentionally keep the particular temporary file names. In this case press "Yes" to cancel file name testing and accept the current selection. Or press "No" to check the temporary file names and select new ones.
Warning: File "..." already exists. Do you want to continue?		This warning message may appear when the program starts encoding a new output file that already exists. Press "Yes" if you wish to overwrite the existing file or press "No" to stop the encoding and enter a new file name.
Warning: Temporary video (audio) file "..." already exists. Do you wish to delete this file and continue to encode? Press <Yes> to delete file or <No> to keep existing file.		The LSX-MPEG encoder creates an outputMPEG file in 3 steps: 1. Encodes the video stream to a temporary file. 2. Encodes the audio stream to a temporary file. 3. Multiplexes the video and audio into a system stream in the output file. You may want to overwrite the existing temporary file or you may want to use the current file that already exists. If you want to overwrite the existing temporary file press "Yes". If you want to use the existing file press "No". The program allows you to skip the 1st and/or 2nd step of encoding if the video or audio stream file already exists. This is convenient when the user needs to change the video (audio) encoding or multiplexing options and does not want to repeat the audio (video) encoding every time. To use this option the temporary file name in the "Files" property page must be the same as the existing file name. If you do not want the temporary video or audio stream file to be deleted after the encoding (default mode), disable the "delete temporary video (audio) file after encoding" option in the "Files" property page. When encoding with the existing audio or video stream temporary file answer "No" in this warning message to use the existing file.


Understanding
  Understanding MPEG

LSX-MPEG Encoder

MPEG-1 and MPEG-2 are motion video compression standards created by the Moving Picture Experts Group. This group is a joint committee of the International Standardization Organization and the International Electrotechnical Commission.

The MPEG-1 Standard, completed as a draft in 1992, defines a bit stream of compressed audio and video data with a data rate of 1.5 mbits/sec as being suitable for CD-ROMs and Video-CD applications. It is possible to generate MPEG-1 streams with other data rates.

The MPEG-2 Standard was designed later for digital transmission of broadcast quality video with data rates from 2 to 10 Mbits/sec.

The MPEG-1 Standard is formally described in ISO/IEC 11172 and the MPEG-2 Standard is described in ISO/IEC 13818 documents.

MPEG-1 and MPEG-2 motion video compression standards are based on the interframe method of compression. This means that some frames are encoded based on representing changes comparatively to another previously encoded frame(s). Since usually only a small portion of the frame changes, it helps to reduce the amount of data to be stored.
An MPEG stream can have three types of frames:
Intra (I)
Predicted (P)
Bi-directional interpolated (B).
Intra (I) frames are coded without any references to any other frames. Predicted (P) frames are coded with references to previously encoded P or I frames. Predicted frames provide significantly better compression than Intra coded (I) frames. Bi-directional interpolated (b) frames contain references to both previous P or I frames and the next P or I frame. Bi-directional frames provide the best compression.

A minimum independently encoded rectangle on the frame is called macroblock. It has a size of  16x16 pixels. When encoding P or B frames the encoder searches each macroblock for the most similar block of pixels from the previously encoded frame. This process is called motion estimation. As a result, the encoder transmits motion vectors that represent the relative coordinates of macroblocks. Then the encoder transmits only the difference between current and preceding macroblocks. To reduce spatial redundancy in data, discrete cosine transformation (DCT) quantization and Haffman encoding are used. Motion estimation is usually the most time consuming part of MPEG encoding. The developers of the LSX-MPEG Encoder created a new algorithm for motion estimation that works faster than other known algorithms and give the result almost equivalent to traditional full search of similar blocks that would take hours of computation time. Discrete cosine transformation (DCT) is a process of representing original data as a linear sum of basic cosine functions with different frequencies. Haffman encoding reduces the amount of transferred data using statistical distribution of quantized DCT coefficients.

The MPEG file consists of compressed video data, called the video stream, and compressed audio data, called the audio stream. It can also contain only one of the streams mentioned above.

When someone starts to encode an MPEG file, he/she has to specify many parameters of the MPEG video stream. Among these parameters are the frame rate and the frame size of the motion video, data rate, which is an average amount of data transferred in an MPEG stream per unit of time, maximum vertical and horizontal motion vector values for P and B frames, which are necessary to limit the area covered by the motion estimation process, frame sequence (i.e. amount of B frames that are to be encoded between every pair of P frames), and the amount of P frames that are to be stored between every pair of I frames. Many other parameters must also be specified. See the section MPEG encoding parameters to learn more about the meaning and requirements of MPEG parameters and see sections Main program window and Advanced parameters dialog box to learn how to enter the required parameters in the LSX-MPEG Encoder program.


Constrained Parameters

LSX-MPEG Encoder

Although it is possible to create MPEG-1 files with frame sizes of up to 4096x4096 and data rates greater than 226 Kbytes/sec, not all decoders can play such MPEG-1 streams. There is a minimum required set of parameters of MPEG-1 streams that many low-end hardware and software MPEG-1 players usually support. The minimun set of parameters is specified below as "constrained parameters".

A "constrained parameter bit stream" is defined in the MPEG-1 Standard as following:

* Horizontal frame size less than or equal 768 pixels.
* Vertical frame size less than or equal 576 pixels.
* Picture area less than or equal 396 macroblocks (101376 pixels).
* Frame rate less than or equal 30 frames/sec.
* Motion vectors less than or equal 64.
* Bitrate less than or equal 1856000 bits/sec (Approx. 226Kbytes/sec).
* VBV buffer size less than or equal to 40 Kbytes/sec. (40 Kbytes/sec for constrained files and 224 Kbytes/sec for non-constrained files.)


  Quick Start Tutorial

LSX-MPEG Encoder

Setting Up a Profile File

When using the LSX-MPEG Encoder, it is important to note that the information used to encode an MPEG file is kept in a profile file. Either the standard profile file is used or you can create a custom profile file. In the Quick Start Tutorial we will assume that you wish to create a custom profile file. Unless a custom profile file is specified, the standard settings will be used when encoding an MPEG file. Here are the steps to be taken when creating a custom profile file.

1. Start the LSX-MPEG Encoder by choosing the program from the Start menu or clicking on the icon for the application in the program group.

2. The Encoder will automatically load a set of standard parameters that are within the scope of the constrained parameters specified for MPEG files. When creating a custom profile file, we will start with this information and customize it to suit our needs.

3. The main screen has variables for input and output filenames which can be typed in or browsed for. The number of frames to encode and number of first frame can also be entered, which allows you to select a portion of the complete file for encoding instead of being forced to encode the entire file. The frame rate in the MPEG file and Video stream data rate are used to set image quality when the file is encoded. The radio buttons for Mpeg-1 and Mpeg-2 are used to determine which type of video stream to encode. The Audio checkbox is used to encode the audio stream portion of an AVI file. If the AVI file does not have an audio component this option will not be available. You will notice that the width and height variables are filled in automatically when you choose an AVI file for input. (Note: Other fields may also be updated with information from the AVI input file when it is specified.) At this time both input and output files must be specified before the profile can be saved. (Note: Input and Output filenames do not have to be the same. If an input file is specified from a read only device like a CD ROM, the encoder will attempt to place the output encoded file into the same directory as the input file, which will fail. Avoid this error by making sure that the output file location is valid.)

4. Now we have the task of customizing the data contained in the Advanced Parameters pages. These pages contain more specific information on how the file will be encoded. These pages can be displayed by clicking on the Advanced button on the Main Application Window.

5. The Motion Vectors page has variable inputs for Maximum Horizontal Motion Vectors, Maximum Vertical Motion Vectors, and for P and B frames. (This property page can be edited when Mpeg-1 with or without Audio or Mpeg-2 with or without Audio is selected from the Main Application Window.)

6. The Sequence Parameters page has variable inputs for the Number of P frames between the nearest I frames and the number of B frames between the nearest P frames. These variables control how many additional frames are to be inserted between known frames in a file. The button selections of I frames only, I and P frames only and Default allow you to specify how the I and P frames are to be inserted into the encoded file. (This property page can be edited when Mpeg-1 with or without Audio or Mpeg-2 with or without Audio is selected from the Main Application Window.)

7. The Performance Parameters page has radio buttons used to select the desired Motion Estimation Mode. These include Very fast, Fast, Normal speed, Slow, and Very slow. (This property page can be edited when Mpeg-1 with or without Audio or Mpeg-2 with or without Audio is selected from the Main Application Window.)

8. The Picture Parameters page has check boxes that allow the user to specify the input and output picture appearance. For video streams, the user can select from showing the input stream when encoding and/or showing the output stream when encoding. For application layout the user can choose to automatically resize the Main Window when encoding and/or stretch image if size of frame is larger than the Main Window. The user can also choose to calculate the image quality when encoding is in progress. This parameter page does not affect the output MPEG file, it only specifies information about the program window appearance. (This property page can be edited when Mpeg-1 with or without Audio or Mpeg-2 with or without Audio is selected from the Main Application Window.)

9. The Audio Parameters page has radio buttons that allow the user to specify the type of audio stream. The four available audio stream types are Mono, Stereo, Dual Channel, and Joint Stereo. The user can choose from the list of common audio stream data rates available (in Kbits/sec.) (This property page can be edited when Mpeg-1 with Audio or Mpeg-2 with Audio is selected from the Main Application Window.)

10. The Sync Parameters page has radio buttons that allow the user to choose to keep original duration time (default) or keep original number of frames. If the user chooses to keep the original duration, the length of time a particular segment of the original AVI file will play for the same amount of time in the output MPEG file. This is called audio-video synchronization, and the user must choose to keep original duration when audio and video information must be synced. If there is no audio information to sync to the video, or if you choose not to include the audio of an AVI file into the output MPEG file, then you can choose to keep the original number of frames, which will encode the file as you have specified, but the playback duration of the file may be different from the original AVI file. For example, if we start with a file that has 600 frames of data that plays at a rate of 10 frames per second, the file will play to completion in just one minute. But, if we encode the file for playback at 20 frames per second, the file will play to completion in just 30 seconds.(This property page can be edited when Mpeg-1 with or without Audio or Mpeg-2 with or without Audio is selected from the Main Application Window.)

11. The Files Parameters page has input fields that allow the user to specify intermediate data filenames during encoding and whether they are to be deleted after compression of the output MPEG file. When the audio checkbox is not selected this page will be displyed but it will not be editable by the user. (This property page can be edited when Mpeg-1 with or without Audio or Mpeg-2 with or without Audio is selected from the Main Application Window.)

12. The System Parameters page has variable inputs for the Mpeg-1 system stream (currently there is no Mpeg-2 system stream available). These include Pack size (<= 4096 bytes), Packets per pack ratio (<= 4 bytes), Size of video buffer (<= 46 Kbits, >= Pack size/1024), and Size of audio buffer (<= 4 Kbits, >= Pack size/1024). There is also a checkbox for fixed bitrate in the multiplexed stream. (This property page can be edited when Mpeg-1 with Audio is selected from the Main Application Window.)

13. The Special Parameters page has radio buttons for choosing between different frame skipping methods. Among these skipping methods are normal mode (default, no frames skipped), Skip one B frame after I or P frame, Skip 2 B frames (before and after I or P frames), and Skip all B frames (for very low bitrates only). (This property page can be edited when Mpeg-1 with or without Audio or Mpeg-2 with or without Audio is selected from the Main Application Window.)

14. The Constrained Parameters page has a checkbox for choosing whether the standard constrained parameter values are used for file encoding. (This is for Mpeg-1 video streams only.) (This property page can be edited when Mpeg-1 with or without Audio is selected from the Main Application Window.)

15. At this point you have updated all the necessary information fields for the MPEG encoding profile file. You can now choose the Save As option under the File Menu to save this profile file to a filename of your choosing. This saved profile file can now be used to encode an AVI file.

Encoding a File

1. The first step in encoding a file is to open a pre-existing profile file to control the encoding process or use the standard settings available in the LSX-MPEG Encoder.

2. Choose the AVI file to be encoded by using the Browse button next to the input filename field. The output filename field will be automatically changed to be the same filename as the input filename except with the appropriate ending extension. The output filename can be changed if you wish.

3. Make any desired changes to the profile, if any.

4. Press the green arrow on the main dialog box to start the encoding process. (Video portion of the file will be encoded first.)

5. Once the Video portion of the AVI file has been encoded the user will see a Video Encoding Completed dialog box which will state the video parameters of the encoded file. Press the OK button to continue encoding. This will encode the Audio portion of the file. (Note: that if video is all that was selected to be encoded, the steps here discussing audio encoding will not be displayed.)

6. Once the audio portion of the file has been encoded, the LSX-MPEG Encoder will automatically start the audio/video multiplexing procedure which will fuse the audio and video portions of the encoded file together in the MPEG output file.

7. When the multiplexing of the audio and video portions of the encoded file have been fused together, the Multiplexing Completed dialog box will be displayed with pertinent information about the encoded file. Press the OK button to complete the encoding process.